Commit aeeefe39 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

pad: Ensure that the pad is blocked for IDLE probes if they are called from...

pad: Ensure that the pad is blocked for IDLE probes if they are called from the streaming thread too

IDLE probes that are directly called when being added will increase /
decrease the "number of IDLE probes running" counter around the call,
but when running from the streaming thread this won't happen.

This has the effect that when running from a streaming thread it is
possible to push serialized events or data out of the pad without
problems, but otherwise it would deadlock because serialized data would
wait for the IDLE probe to finish first (it is blocking after all!).

With this change it will now always consistently deadlock instead of
just every once in a while, which should make it obvious why this
happens and prevent racy deadlocks in application code.
parent bb3fbfbe
......@@ -3557,12 +3557,18 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
info->id = hook->hook_id;
if ((flags & GST_PAD_PROBE_TYPE_IDLE))
ret = callback (pad, info, hook->data);
if ((flags & GST_PAD_PROBE_TYPE_IDLE))
if (original_data != NULL && info->data == NULL) {
GST_DEBUG_OBJECT (pad, "data item in pad probe info was dropped");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment