From 3e455f8a5bc2d11cc4adf5279b1a7f09c8058cb3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 12 Apr 2007 10:03:22 +0000 Subject: [PATCH] gst/gdp/gstgdppay.c: Make sure we set the IN_CAPS flag correctly. Original commit message from CVS: * gst/gdp/gstgdppay.c: (gst_gdp_pay_chain), (gst_gdp_pay_sink_event): Make sure we set the IN_CAPS flag correctly. * gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_render): Get the IN_CAPS flag before we call functions that mess with the flags. --- ChangeLog | 9 +++++++++ gst/gdp/gstgdppay.c | 8 ++++++-- gst/tcp/gstmultifdsink.c | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c979bd8b8c..0dee2a52f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-04-12 Wim Taymans + + * gst/gdp/gstgdppay.c: (gst_gdp_pay_chain), + (gst_gdp_pay_sink_event): + Make sure we set the IN_CAPS flag correctly. + + * gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_render): + Get the IN_CAPS flag before we call functions that mess with the flags. + 2007-04-10 Thomas Vander Stichele * gst/gdp/gstgdppay.c (gst_gdp_pay_reset_streamheader, diff --git a/gst/gdp/gstgdppay.c b/gst/gdp/gstgdppay.c index 56beff3b71..9f3e0d6313 100644 --- a/gst/gdp/gstgdppay.c +++ b/gst/gdp/gstgdppay.c @@ -563,6 +563,7 @@ gst_gdp_pay_chain (GstPad * pad, GstBuffer * buffer) } else { GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_DURATION (outbuffer) = 0; + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf", outbuffer); this->new_segment_buf = outbuffer; @@ -661,22 +662,25 @@ gst_gdp_pay_sink_event (GstPad * pad, GstEvent * event) * and not send it on */ switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT: - GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf", + GST_DEBUG_OBJECT (this, "Storing in caps buffer %p as new_segment_buf", outbuffer); if (this->new_segment_buf) gst_buffer_unref (this->new_segment_buf); this->new_segment_buf = outbuffer; + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); gst_gdp_pay_reset_streamheader (this); break; case GST_EVENT_TAG: - GST_DEBUG_OBJECT (this, "Storing buffer %p as tag_buf", outbuffer); + GST_DEBUG_OBJECT (this, "Storing in caps buffer %p as tag_buf", + outbuffer); if (this->tag_buf) gst_buffer_unref (this->tag_buf); this->tag_buf = outbuffer; + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); gst_gdp_pay_reset_streamheader (this); break; default: diff --git a/gst/tcp/gstmultifdsink.c b/gst/tcp/gstmultifdsink.c index 9f4244cee0..845a86802d 100644 --- a/gst/tcp/gstmultifdsink.c +++ b/gst/tcp/gstmultifdsink.c @@ -2374,6 +2374,9 @@ gst_multi_fd_sink_render (GstBaseSink * bsink, GstBuffer * buf) if (!padcaps && !bufcaps) goto no_caps; + /* get IN_CAPS first, code below might mess with the flags */ + in_caps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + /* stamp the buffer with previous caps if no caps set */ if (!bufcaps) { if (!gst_buffer_is_metadata_writable (buf)) { @@ -2398,8 +2401,6 @@ gst_multi_fd_sink_render (GstBaseSink * bsink, GstBuffer * buf) gst_buffer_ref (buf); } - in_caps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS); - GST_LOG_OBJECT (sink, "received buffer %p, in_caps: %d", buf, in_caps); /* if we get IN_CAPS buffers, but the previous buffer was not IN_CAPS,