ext/mad/gstid3tag.c: rewrite buffer offset

Original commit message from CVS:
* ext/mad/gstid3tag.c: (gst_id3_tag_handle_event),
(gst_id3_tag_chain):
rewrite buffer offset
This commit is contained in:
Benjamin Otte 2004-04-29 00:13:16 +00:00
parent 69c4791b98
commit a616e75b74
2 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2004-04-29 Benjamin Otte <otte@gnome.org>
* ext/mad/gstid3tag.c: (gst_id3_tag_handle_event),
(gst_id3_tag_chain):
rewrite buffer offset
2004-04-28 Ronald Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:

View file

@ -760,7 +760,10 @@ gst_id3_tag_handle_event (GstPad * pad, GstEvent * event)
GST_BUFFER_SIZE (tag->buffer)
: 0))
GST_ELEMENT_ERROR (tag, CORE, EVENT, (NULL),
("Seek during ID3v2 tag reading"));
("Got seek to %" G_GUINT64_FORMAT " during ID3v2 tag reading"
" (allowed was %" G_GUINT64_FORMAT ")", value,
(guint64) (tag->buffer ? GST_BUFFER_OFFSET (tag->buffer)
+ GST_BUFFER_SIZE (tag->buffer) : 0)));
}
gst_data_unref (GST_DATA (event));
break;
@ -1162,6 +1165,16 @@ gst_id3_tag_chain (GstPad * pad, GstData * data)
gst_data_unref (GST_DATA (buffer));
buffer = sub;
}
if (tag->v2tag_size) {
GstBuffer *sub =
gst_buffer_create_sub (buffer, 0, GST_BUFFER_SIZE (buffer));
GST_BUFFER_OFFSET (sub) =
GST_BUFFER_OFFSET (buffer) - tag->v2tag_size;
GST_BUFFER_OFFSET_END (sub) =
GST_BUFFER_OFFSET_END (buffer) - tag->v2tag_size;
gst_data_unref (GST_DATA (buffer));
buffer = sub;
}
gst_pad_push (tag->srcpad, GST_DATA (buffer));
}
return;