From 473be88d5d187ecd1b445137683ae7621d0662b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 30 Sep 2010 16:22:04 -0400 Subject: [PATCH] valve: Correctly set the DISCONT flag after dropping buffers --- plugins/elements/gstvalve.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/elements/gstvalve.c b/plugins/elements/gstvalve.c index 38bc52cfc4..8754abdaaa 100644 --- a/plugins/elements/gstvalve.c +++ b/plugins/elements/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 -- 2.34.1