Commit 3f72e720 authored by Jan Schmidt's avatar Jan Schmidt

gst/: Don't attempt typefinding on too-short buffers that have been completely trimmed away.

Original commit message from CVS:
* gst/apetag/gsttagdemux.c: (gst_tag_demux_chain):
* gst/id3demux/gstid3demux.c: (gst_id3demux_chain):
Don't attempt typefinding on too-short buffers that have been
completely trimmed away.
* gst/id3demux/id3tags.c: (id3demux_read_id3v2_tag):
Improve the debug output
parent e7a2d773
2006-03-22 Jan Schmidt <thaytan@mad.scientist.com>
* gst/apetag/gsttagdemux.c: (gst_tag_demux_chain):
* gst/id3demux/gstid3demux.c: (gst_id3demux_chain):
Don't attempt typefinding on too-short buffers that have been
completely trimmed away.
* gst/id3demux/id3tags.c: (id3demux_read_id3v2_tag):
Improve the debug output
2006-03-21 Wim Taymans <wim@fluendo.com>
* ext/esd/esdsink.c: (gst_esdsink_class_init), (gst_esdsink_init),
......
......@@ -543,7 +543,8 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf)
GstBuffer *typefind_buf = NULL;
GstCaps *caps;
if (GST_BUFFER_SIZE (demux->priv->collect) < TYPE_FIND_MIN_SIZE)
if (GST_BUFFER_SIZE (demux->priv->collect) <
TYPE_FIND_MIN_SIZE + demux->priv->strip_start)
break; /* Go get more data first */
GST_DEBUG_OBJECT (demux, "Typefinding with size %d",
......@@ -555,6 +556,9 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf)
if (!gst_tag_demux_trim_buffer (demux, &typefind_buf))
return GST_FLOW_ERROR;
if (typefind_buf == NULL)
break; /* Still need more data */
caps = gst_type_find_helper_for_buffer (GST_OBJECT (demux),
typefind_buf, &probability);
......
......@@ -433,7 +433,8 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf)
GstBuffer *typefind_buf = NULL;
GstCaps *caps;
if (GST_BUFFER_SIZE (id3demux->collect) < ID3_TYPE_FIND_MIN_SIZE)
if (GST_BUFFER_SIZE (id3demux->collect) <
ID3_TYPE_FIND_MIN_SIZE + id3demux->strip_start)
break; /* Go get more data first */
GST_DEBUG_OBJECT (id3demux, "Typefinding with size %d",
......@@ -445,6 +446,9 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf)
if (!gst_id3demux_trim_buffer (id3demux, &typefind_buf))
return GST_FLOW_ERROR;
if (typefind_buf == NULL)
break; /* Still need more data */
caps = gst_type_find_helper_for_buffer (GST_OBJECT (id3demux),
typefind_buf, &probability);
......
......@@ -167,10 +167,17 @@ id3demux_read_id3v2_tag (GstBuffer * buffer, guint * id3v2_size,
version >> 8, version & 0xff, ID3V2_VERSION >> 8, ID3V2_VERSION & 0xff);
return ID3TAGS_READ_TAG;
}
GST_DEBUG ("ID3v2 tag with revision 2.%d.%d\n", version >> 8, version & 0xff);
if (GST_BUFFER_SIZE (buffer) < read_size)
if (GST_BUFFER_SIZE (buffer) < read_size) {
GST_DEBUG
("Found ID3v2 tag with revision 2.%d.%d - need %u more bytes to read",
version >> 8, version & 0xff,
(guint) (read_size - GST_BUFFER_SIZE (buffer)));
return ID3TAGS_MORE_DATA; /* Need more data to decode with */
}
GST_DEBUG ("Reading ID3v2 tag with revision 2.%d.%d of size %u", version >> 8,
version & 0xff, read_size);
g_return_val_if_fail (tags != NULL, ID3TAGS_READ_TAG);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment