From bf824405795650ffd6ac6c87d244f76a1d18c051 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 10 Apr 2007 20:37:05 +0000 Subject: [PATCH] gst/gdp/gstgdppay.c (gst_gdp_pay_reset_streamheader, gst_gdp_pay_chain, gst_gdp_pay_sink_event): Original commit message from CVS: * gst/gdp/gstgdppay.c (gst_gdp_pay_reset_streamheader, gst_gdp_pay_chain, gst_gdp_pay_sink_event): Only stamp buffers with offset/offset_end right before they get pushed. This ensures offset continuity, which was not the case before as shown by gst-launch -v -m audiotestsrc num-buffers=10 ! audioconvert ! vorbisenc ! gdppay ! identity check-imperfect-offset=TRUE ! fakesink silent=TRUE --- ChangeLog | 9 +++++++++ gst/gdp/gstgdppay.c | 12 +++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e93afca0a..c979bd8b8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-04-10 Thomas Vander Stichele + + * gst/gdp/gstgdppay.c (gst_gdp_pay_reset_streamheader, + gst_gdp_pay_chain, gst_gdp_pay_sink_event): + Only stamp buffers with offset/offset_end right before they get + pushed. This ensures offset continuity, which was not the case + before as shown by + gst-launch -v -m audiotestsrc num-buffers=10 ! audioconvert ! vorbisenc ! gdppay ! identity check-imperfect-offset=TRUE ! fakesink silent=TRUE + 2007-04-06 Wim Taymans * gst/playback/gstplaybin.c: (add_sink), diff --git a/gst/gdp/gstgdppay.c b/gst/gdp/gstgdppay.c index 94e76a3062..56beff3b71 100644 --- a/gst/gdp/gstgdppay.c +++ b/gst/gdp/gstgdppay.c @@ -354,10 +354,13 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this) } } - /* put copies of the buffers in a fixed list */ + /* put copies of the buffers in a fixed list + * Stamp the buffers with offset and offset_end as well. + * We do this here so the offsets match the order the buffers go out in */ g_value_init (&array, GST_TYPE_ARRAY); if (version_one_zero) { + gst_gdp_stamp_buffer (this, this->new_segment_buf); GST_DEBUG_OBJECT (this, "1.0, appending copy of new segment buffer %p", this->new_segment_buf); new_segment_buf = gst_buffer_copy (this->new_segment_buf); @@ -368,6 +371,7 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this) gst_buffer_unref (new_segment_buf); if (this->tag_buf) { + gst_gdp_stamp_buffer (this, this->tag_buf); GST_DEBUG_OBJECT (this, "1.0, appending copy of tag buffer %p", this->tag_buf); tag_buf = gst_buffer_copy (this->tag_buf); @@ -379,6 +383,7 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this) } } + gst_gdp_stamp_buffer (this, this->caps_buf); GST_DEBUG_OBJECT (this, "appending copy of caps buffer %p", this->caps_buf); caps_buf = gst_buffer_copy (this->caps_buf); g_value_init (&value, GST_TYPE_BUFFER); @@ -556,7 +561,6 @@ gst_gdp_pay_chain (GstPad * pad, GstBuffer * buffer) GST_ELEMENT_WARNING (this, STREAM, ENCODE, (NULL), ("Could not create GDP buffer from new segment event")); } else { - gst_gdp_stamp_buffer (this, outbuffer); GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_DURATION (outbuffer) = 0; GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf", @@ -578,7 +582,6 @@ gst_gdp_pay_chain (GstPad * pad, GstBuffer * buffer) if (!outbuffer) goto no_caps_buffer; - gst_gdp_stamp_buffer (this, outbuffer); GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_DURATION (outbuffer) = 0; GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); @@ -651,11 +654,10 @@ gst_gdp_pay_sink_event (GstPad * pad, GstEvent * event) if (!outbuffer) goto no_outbuffer; - gst_gdp_stamp_buffer (this, outbuffer); GST_BUFFER_TIMESTAMP (outbuffer) = GST_EVENT_TIMESTAMP (event); GST_BUFFER_DURATION (outbuffer) = 0; - /* if we got a new segment, we should put it on our streamheader, + /* if we got a new segment or tag event, we should put it on our streamheader, * and not send it on */ switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT: