diff --git a/ChangeLog b/ChangeLog index aa199749d1..18d8a08526 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-03-22 Jan Schmidt + + * 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 * ext/esd/esdsink.c: (gst_esdsink_class_init), (gst_esdsink_init), diff --git a/gst/apetag/gsttagdemux.c b/gst/apetag/gsttagdemux.c index 2c42b599b3..53ca188138 100644 --- a/gst/apetag/gsttagdemux.c +++ b/gst/apetag/gsttagdemux.c @@ -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); diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index 3d7ee5ba00..e9f22c94ab 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -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); diff --git a/gst/id3demux/id3tags.c b/gst/id3demux/id3tags.c index 157d601d9e..bd370ed5be 100644 --- a/gst/id3demux/id3tags.c +++ b/gst/id3demux/id3tags.c @@ -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);