summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-12-13 00:31:45 -0500
committerEdward Hervey <bilboed@bilboed.com>2009-02-17 19:29:59 +0100
commit06b1c78adeef13ac30f486d09a16ff775d355448 (patch)
tree77d9e82e324fdab4ed56c051406e289eb9b2ab20 /gst
parentbaa5d1eacf4c0ff63799177a9b0b7abc38317a5b (diff)
downloadgst-plugins-bad-06b1c78adeef13ac30f486d09a16ff775d355448.tar.gz
gst-plugins-bad-06b1c78adeef13ac30f486d09a16ff775d355448.tar.bz2
gst-plugins-bad-06b1c78adeef13ac30f486d09a16ff775d355448.zip
[MOVED FROM GST-P-FARSIGHT] Ignore errors if dropping is set to true
Diffstat (limited to 'gst')
-rw-r--r--gst/valve/gstvalve.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/valve/gstvalve.c b/gst/valve/gstvalve.c
index ecd0f7dc..a61e009e 100644
--- a/gst/valve/gstvalve.c
+++ b/gst/valve/gstvalve.c
@@ -204,6 +204,12 @@ gst_valve_chain (GstPad *pad, GstBuffer *buffer)
else
ret = gst_pad_push (valve->srcpad, buffer);
+
+ GST_OBJECT_LOCK (GST_OBJECT (valve));
+ if (valve->drop)
+ ret = GST_FLOW_OK;
+ GST_OBJECT_UNLOCK (GST_OBJECT (valve));
+
gst_object_unref (valve);
return ret;
@@ -226,6 +232,11 @@ gst_valve_event (GstPad *pad, GstEvent *event)
else
ret = gst_pad_push_event (valve->srcpad, event);
+ GST_OBJECT_LOCK (GST_OBJECT (valve));
+ if (valve->drop)
+ ret = TRUE;
+ GST_OBJECT_UNLOCK (GST_OBJECT (valve));
+
gst_object_unref (valve);
return ret;
}
@@ -247,6 +258,11 @@ gst_valve_buffer_alloc (GstPad * pad, guint64 offset, guint size,
else
ret = gst_pad_alloc_buffer (valve->srcpad, offset, size, caps, buf);
+ GST_OBJECT_LOCK (GST_OBJECT (valve));
+ if (valve->drop)
+ ret = GST_FLOW_OK;
+ GST_OBJECT_UNLOCK (GST_OBJECT (valve));
+
gst_object_unref (valve);
return ret;