diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index e2a10e7d39..3def996e1b 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1876,25 +1876,26 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream) case GST_FLOW_OK: break; /* all is good, let's go */ case GST_FLOW_EOS: - GST_DEBUG_OBJECT (stream->pad, "EOS, stopping download loop"); + GST_DEBUG_OBJECT (stream->pad, "EOS, checking to stop download loop"); /* we push the EOS after releasing the object lock */ - - if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) { - if (gst_adaptive_demux_has_next_period (demux)) { - gst_task_pause (stream->download_task); - gst_adaptive_demux_advance_period (demux); - ret = GST_FLOW_OK; - goto end; - } else if (gst_adaptive_demux_is_live (demux)) { - if (gst_adaptive_demux_stream_wait_manifest_update (demux, stream)) { - GST_MANIFEST_UNLOCK (demux); - return; + if (gst_adaptive_demux_is_live (demux)) { + if (gst_adaptive_demux_stream_wait_manifest_update (demux, stream)) { + GST_MANIFEST_UNLOCK (demux); + return; + } + gst_task_pause (stream->download_task); + } else { + if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) { + if (gst_adaptive_demux_has_next_period (demux)) { + gst_task_pause (stream->download_task); + gst_adaptive_demux_advance_period (demux); + ret = GST_FLOW_OK; + goto end; + } else { + gst_task_pause (stream->download_task); } - - gst_task_pause (stream->download_task); - } else { - gst_task_pause (stream->download_task); + ret = GST_FLOW_OK; } } break;