From df66909129550aa22c97f981ddf1fdf95c492bee Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sun, 30 Nov 2014 21:54:38 -0300 Subject: [PATCH] adaptivedemux: reworking live manifest update wait Check if the stream is live before checking if it is EOS as a live stream might be considered EOS when it just needs to wait for a manifest update to proceed with the next fragments --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) 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;