diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2016-03-24 18:13:39 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-06-17 14:08:57 +0300 |
commit | e6dd8d85c02e83e507b1d709dd922b1c17439bfd (patch) | |
tree | 2cba9a342daeeca999cfe79694ec6ab4a0375755 | |
parent | a87289ece29fc457fbc2c593a40cc4df2c119986 (diff) |
pad: consider PROBE_TYPE_EVENT_FLUSH when using PROBE_TYPE_ALL_BOTH
When GST_PAD_PROBE_EVENT_FLUSH is used, the probes already have
a data type and it is not needed to automatically add the default
types. Without this, EVENT_FLUSH probes that didn't specify a data
type would be called also for other data such as buffers.
https://bugzilla.gnome.org/show_bug.cgi?id=762330
-rw-r--r-- | gst/gstpad.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index d357ec14ea..a499411ae4 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -123,6 +123,8 @@ enum #define GST_PAD_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_PAD, GstPadPrivate)) +#define _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH (GST_PAD_PROBE_TYPE_ALL_BOTH | GST_PAD_PROBE_TYPE_EVENT_FLUSH) + /* we have a pending and an active event on the pad. On source pads only the * active event is used. On sinkpads, events are copied to the pending entry and * moved to the active event when the eventfunc returned %TRUE. */ @@ -1380,7 +1382,7 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask, /* when no contraints are given for the types, assume all types are * acceptable */ - if ((mask & GST_PAD_PROBE_TYPE_ALL_BOTH) == 0) + if ((mask & _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH) == 0) mask |= GST_PAD_PROBE_TYPE_ALL_BOTH; if ((mask & GST_PAD_PROBE_TYPE_SCHEDULING) == 0) mask |= GST_PAD_PROBE_TYPE_SCHEDULING; @@ -3408,7 +3410,7 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data) /* one of the data types for non-idle probes */ if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0 - && (flags & GST_PAD_PROBE_TYPE_ALL_BOTH & type) == 0) + && (flags & _PAD_PROBE_TYPE_ALL_BOTH_AND_FLUSH & type) == 0) goto no_match; /* one of the scheduling types */ if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0) |