When shutting down the chain, we can get a deadlock when removing
a pad, if that chain was being busy streaming but blocked (eg, while
waiting for a queue to have free space).
https://bugzilla.gnome.org/show_bug.cgi?id=746480
if (chain->endpad) {
if (chain->endpad->exposed) {
- gst_element_remove_pad (GST_ELEMENT_CAST (chain->dbin),
- GST_PAD_CAST (chain->endpad));
+ GstPad *endpad = GST_PAD_CAST (chain->endpad);
+ gst_pad_push_event (endpad, gst_event_new_flush_start ());
+ gst_pad_push_event (endpad, gst_event_new_flush_stop (FALSE));
+ gst_element_remove_pad (GST_ELEMENT_CAST (chain->dbin), endpad);
}
decode_pad_set_target (chain->endpad, NULL);