adaptivedemux: release threads waiting for manifest update on shutdown
authorThiago Santos <thiagoss@osg.samsung.com>
Wed, 3 Dec 2014 21:31:06 +0000 (18:31 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Thu, 4 Dec 2014 04:48:07 +0000 (01:48 -0300)
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

index dc340df..c35bfb1 100644 (file)
@@ -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;
     }