From: <te...@ke...> - 2010-09-30 21:45:11
|
Module: gst-plugins-bad Branch: master Commit: 0af7cc8ba735fc1c1de8c52e0201e51cf1ae5ef5 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=0af7cc8ba735fc1c1de8c52e0201e51cf1ae5ef5 Author: Olivier Crête <oli...@co...> Date: Thu Sep 30 16:22:04 2010 -0400 valve: Correctly set the DISCONT flag after dropping buffers --- gst/valve/gstvalve.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gst/valve/gstvalve.c b/gst/valve/gstvalve.c index 38bc52c..8754abd 100644 --- a/gst/valve/gstvalve.c +++ b/gst/valve/gstvalve.c @@ -190,18 +190,19 @@ gst_valve_chain (GstPad * pad, GstBuffer * buffer) GST_OBJECT_LOCK (valve); drop = valve->drop; - - if (!drop && valve->discont) { - buffer = gst_buffer_make_metadata_writable (buffer); - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); - valve->discont = FALSE; - } GST_OBJECT_UNLOCK (valve); - if (drop) + if (drop) { gst_buffer_unref (buffer); - else + valve->discont = TRUE; + } else { + if (valve->discont) { + buffer = gst_buffer_make_metadata_writable (buffer); + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); + } + ret = gst_pad_push (valve->srcpad, buffer); + } /* Ignore errors if "drop" was changed while the thread was blocked |