From 023b284c2d3c20feb4a7ea2b7e9798829c81c087 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sat, 22 Nov 2014 17:27:03 -0300 Subject: [PATCH] adaptivedemux: also clear flushing state on pads before restarting During flushing seeks the flushing flow return will propagate up to the source element and all pads are going to have the flushing flag set. So before restarting also remove that flag together with the EOS one. We don't do that when pushing the flush stop event because our event handler for the proxypad will drop all events. --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index cc9f398ee0..2b62d5dd8b 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1372,7 +1372,8 @@ _adaptive_demux_pad_remove_eos_sticky (GstPad * pad, GstEvent ** event, } static void -gst_adaptive_demux_stream_clear_eos_state (GstAdaptiveDemuxStream * stream) +gst_adaptive_demux_stream_clear_eos_and_flush_state (GstAdaptiveDemuxStream * + stream) { GstPad *internal_pad; @@ -1381,6 +1382,10 @@ gst_adaptive_demux_stream_clear_eos_state (GstAdaptiveDemuxStream * stream) gst_pad_sticky_events_foreach (internal_pad, _adaptive_demux_pad_remove_eos_sticky, NULL); GST_OBJECT_FLAG_UNSET (internal_pad, GST_PAD_FLAG_EOS); + /* In case the stream is recovering from a flushing seek it is also needed + * to remove the flushing state from this pad. The flushing state is set + * because of the flow return propagating until the source element */ + GST_PAD_UNSET_FLUSHING (internal_pad); gst_object_unref (internal_pad); } @@ -1561,7 +1566,7 @@ gst_adaptive_demux_stream_download_uri (GstAdaptiveDemux * demux, gst_pad_push_event (stream->src_srcpad, gst_event_new_flush_stop (TRUE)); gst_element_set_state (stream->src, GST_STATE_READY); - gst_adaptive_demux_stream_clear_eos_state (stream); + gst_adaptive_demux_stream_clear_eos_and_flush_state (stream); return ret; }