From aed32ee2abf866f905b710102ef1a3f2dcd4e502 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 4 Sep 2017 14:33:29 +0200 Subject: [PATCH] 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 --- gst/gstpad.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/gstpad.c b/gst/gstpad.c index 67e85355d2..a5475ab661 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3425,6 +3425,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