pad: Only call IDLE probes if we are actually idle

Also only check the data types for non-IDLE probes. When we
are idle, we have no data type obviously.

Previously we were calling IDLE probes during data flow whenever
a non-blocking probe would be called. The pad was usually not idle
at that time.
This commit is contained in:
Sebastian Dröge 2013-12-30 18:44:24 +01:00
parent 2ddbe8df49
commit 0324358ebc

View file

@ -3061,8 +3061,9 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT; flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT;
type = info->type; type = info->type;
/* one of the data types */ /* one of the data types for non-idle probes */
if ((flags & GST_PAD_PROBE_TYPE_ALL_BOTH & type) == 0) if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0
&& (flags & GST_PAD_PROBE_TYPE_ALL_BOTH & type) == 0)
goto no_match; goto no_match;
/* one of the scheduling types */ /* one of the scheduling types */
if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0) if ((flags & GST_PAD_PROBE_TYPE_SCHEDULING & type) == 0)
@ -3071,6 +3072,9 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
if ((type & GST_PAD_PROBE_TYPE_BLOCKING) && if ((type & GST_PAD_PROBE_TYPE_BLOCKING) &&
(flags & GST_PAD_PROBE_TYPE_BLOCKING & type) == 0) (flags & GST_PAD_PROBE_TYPE_BLOCKING & type) == 0)
goto no_match; goto no_match;
if ((type & GST_PAD_PROBE_TYPE_BLOCKING) == 0 &&
(flags & GST_PAD_PROBE_TYPE_BLOCKING))
goto no_match;
/* only probes that have GST_PAD_PROBE_TYPE_EVENT_FLUSH set */ /* only probes that have GST_PAD_PROBE_TYPE_EVENT_FLUSH set */
if ((type & GST_PAD_PROBE_TYPE_EVENT_FLUSH) && if ((type & GST_PAD_PROBE_TYPE_EVENT_FLUSH) &&
(flags & GST_PAD_PROBE_TYPE_EVENT_FLUSH & type) == 0) (flags & GST_PAD_PROBE_TYPE_EVENT_FLUSH & type) == 0)