From 66f40b798dd44e2d1c80d2bc77f29e8ad735461f Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 3 Dec 2014 18:31:06 -0300 Subject: [PATCH] adaptivedemux: release threads waiting for manifest update on shutdown For live streams, also unblock threads that might be waiting for a manifest update when stopping the pipeline. Also add some more debug messages --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index dc340df3d1..c35bfb1edb 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1050,6 +1050,10 @@ gst_adaptive_demux_stop_tasks (GstAdaptiveDemux * demux) gst_task_stop (demux->priv->updates_task); g_cond_signal (&demux->priv->updates_timed_cond); + GST_MANIFEST_LOCK (demux); + g_cond_broadcast (&demux->manifest_cond); + GST_MANIFEST_UNLOCK (demux); + gst_uri_downloader_cancel (demux->priv->downloader); for (iter = demux->streams; iter; iter = g_list_next (iter)) { GstAdaptiveDemuxStream *stream = iter->data; @@ -1361,11 +1365,15 @@ gst_adaptive_demux_stream_wait_manifest_update (GstAdaptiveDemux * demux, /* Got a new fragment or not live anymore? */ if (gst_adaptive_demux_stream_has_next_fragment (demux, stream)) { + GST_DEBUG_OBJECT (demux, "new fragment available, " + "not waiting for manifest update"); ret = TRUE; break; } if (!gst_adaptive_demux_is_live (demux)) { + GST_DEBUG_OBJECT (demux, "Not live anymore, " + "not waiting for manifest update"); ret = FALSE; break; }