pad: Fix pad state when deactivating from one mode and then trying to activate another and failing

When activating a pad in PULL mode, it might already be in PUSH mode. We now
first try to deactivate it from PUSH mode and then try to activate it in PULL
mode. If the activation fails, we would set the pad to flushing and set it
back to its old mode. However the old mode is wrong, the pad is not in PUSH
mode anymore but in NONE mode.

This fixes e.g. typefind in decodebin reactivating PUSH/PULL mode if upstream
actually fails to go into PULL mode after first PUSHING data to typefind.
This commit is contained in:
Sebastian Dröge 2016-05-10 15:01:42 +03:00
parent 89fac4e81b
commit 7eb494257c

View file

@ -1135,6 +1135,7 @@ activate_mode_internal (GstPad * pad, GstObject * parent, GstPadMode mode,
if (G_UNLIKELY (!activate_mode_internal (pad, parent, old, FALSE))) if (G_UNLIKELY (!activate_mode_internal (pad, parent, old, FALSE)))
goto deactivate_failed; goto deactivate_failed;
old = GST_PAD_MODE_NONE;
} }
switch (mode) { switch (mode) {