decodebin: Properly deactivate ghostpads

Just setting the ghostpad as flushing wasn't enough. It needs to be
consistent on the internal proxypad also, otherwise you end up in
situations where:
* a pending buffer on the target pad triggers the sticky event
  propagation
* the default implementation sees that the proxypad is not flushing,
  so it tries to push it to the other pad (the actual ghostpad)
* the ghostpad is flushing, so returns FALSE
* the push_event function sees that pushing the event failed...
* ... and pending buffer push returns GST_FLOW_ERROR, instead of
  GST_FLOW_FLUSHING

By using gst_pad_set_active(FALSE), we ensure that both the ghostpad
and the proxypad are flushing/deactivated. The situation above will
no longer occur, and a GST_FLOW_FLUSHING will be returned.
This commit is contained in:
Edward Hervey 2015-11-06 19:31:47 +01:00 committed by Edward Hervey
parent d2e210bbea
commit d0eface01c

View file

@ -5111,7 +5111,7 @@ unblock_pads (GstDecodeBin * dbin)
}
dpad->blocked = FALSE;
/* make flushing, prevent NOT_LINKED */
GST_PAD_SET_FLUSHING (GST_PAD_CAST (dpad));
gst_pad_set_active (GST_PAD_CAST (dpad), FALSE);
gst_object_unref (dpad);
gst_object_unref (opad);
GST_DEBUG_OBJECT (dpad, "unblocked");