Commit 45447337 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

decodebin2: mind blocked pads when shutting down

Fix regression in shutdown deadlock handling now that the
target of a ghostpad is blocked instead of ghostpad itself.

See also #574293.
parent 3b842bc9
......@@ -3164,14 +3164,20 @@ gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked)
if (!opad)
goto out;
gst_pad_set_blocked_async_full (opad, blocked,
(GstPadBlockCallback) source_pad_blocked_cb, gst_object_ref (dpad),
(GDestroyNotify) gst_object_unref);
/* do not block if shutting down.
* we do not consider/expect it blocked further below, but use other trick */
if (!blocked || !dbin->shutdown)
gst_pad_set_blocked_async_full (opad, blocked,
(GstPadBlockCallback) source_pad_blocked_cb, gst_object_ref (dpad),
(GDestroyNotify) gst_object_unref);
if (blocked) {
if (dbin->shutdown) {
/* deactivate to force flushing state to prevent NOT_LINKED errors */
gst_pad_set_active (GST_PAD_CAST (dpad), FALSE);
/* note that deactivating the target pad would have no effect here,
* since elements are typically connected first (and pads exposed),
* and only then brought to PAUSED state (so pads activated) */
} else {
gst_object_ref (dpad);
dbin->blocked_pads = g_list_prepend (dbin->blocked_pads, dpad);
......
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