summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-09-04 14:33:29 +0200
committerEdward Hervey <bilboed@bilboed.com>2017-12-06 17:11:05 +0100
commit7153205b7afebbcc9bb84f6286da132e91841745 (patch)
tree721376dfa70ece50cca0c4284a1486f506a9cd8e
parenta4838770c92269aa237dc589c7a1547c12c1ea86 (diff)
pad: Don't call remaining probes after they return DROPPED|HANDLED
If multiple probes are set on a pad and one probe returns either GST_PAD_PROBE_HANDLED or GST_PAD_PROBE_DROPPED we need to stop calling the remaining probes. https://bugzilla.gnome.org/show_bug.cgi?id=787243
-rw-r--r--gst/gstpad.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c
index e4b9e5c8b..5cb3d1b9a 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -3465,6 +3465,16 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0)
goto no_match;
+ if (G_UNLIKELY (data->handled)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
+ "probe previously returned HANDLED, not calling again");
+ goto no_match;
+ } else if (G_UNLIKELY (data->dropped)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
+ "probe previously returned DROPPED, not calling again");
+ goto no_match;
+ }
+
if (type & GST_PAD_PROBE_TYPE_PUSH) {
/* one of the data types for non-idle probes */
if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0