From 2c766ca5084ac13e4462e4f9e01b0ba7b1f1a26e Mon Sep 17 00:00:00 2001 From: "Arwed v. Merkatz" Date: Sun, 6 Jun 2004 21:03:07 +0000 Subject: [PATCH] ext/mad/gstid3tag.c: forward correctly transformed offset in discont events. Based on Original commit message from CVS: * ext/mad/gstid3tag.c: (gst_id3_tag_handle_event): forward correctly transformed offset in discont events. Based on patch by Arwed v. Merkatz. (fixes #142851) --- ChangeLog | 6 ++++++ ext/mad/gstid3tag.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 39a4b03d08..bbcb32f878 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-06-06 Benjamin Otte + + * ext/mad/gstid3tag.c: (gst_id3_tag_handle_event): + forward correctly transformed offset in discont events. Based on + patch by Arwed v. Merkatz. (fixes #142851) + 2004-06-06 David Schleef * gst/ffmpegcolorspace/gstffmpegcodecmap.c: that's diff --git a/ext/mad/gstid3tag.c b/ext/mad/gstid3tag.c index f3b4cccf67..16efc56900 100644 --- a/ext/mad/gstid3tag.c +++ b/ext/mad/gstid3tag.c @@ -798,7 +798,12 @@ gst_id3_tag_handle_event (GstPad * pad, GstEvent * event) GstEvent *new; if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value)) { - value += tag->v1tag_size; + if (value > tag->v2tag_size) { + value -= tag->v2tag_size; + } else { + /* FIXME: throw an error here? */ + value = 0; + } new = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, value, 0); gst_data_unref (GST_DATA (event));