From a2e391cb689ce56ea24f0c0aadda3f0ecdaee4f3 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 22 Mar 2006 13:00:34 +0000 Subject: [PATCH] tag: id3v2: 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-libs/gst/tag/gstid3demux.c: (gst_id3demux_chain): Don't attempt typefinding on too-short buffers that have been completely trimmed away. * gst-libs/gst/tag/id3v2.c: (id3demux_read_id3v2_tag): Improve the debug output --- gst-libs/gst/tag/id3v2.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/tag/id3v2.c b/gst-libs/gst/tag/id3v2.c index 157d601d9e..bd370ed5be 100644 --- a/gst-libs/gst/tag/id3v2.c +++ b/gst-libs/gst/tag/id3v2.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);