[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-cvs
Subject:    gst-plugins-bad: hlsdemux: properly stop tasks by stopping fragment download
From:       thiagoss () kemper ! freedesktop ! org (Thiago Sousa Santos)
Date:       2014-04-29 22:01:38
Message-ID: 20140429220138.AD919761E3 () kemper ! freedesktop ! org
[Download RAW message or body]

Module: gst-plugins-bad
Branch: master
Commit: 2b73e86881881a78c6e40ed65e5ae6c5e1250e12
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=2b73e86881881a78c6e40ed65e5ae6c5e1250e12


Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Fri Apr 25 12:55:54 2014 -0300

hlsdemux: properly stop tasks by stopping fragment download

Issue a signal to the fragment download cond to stop
the task earlier

---

 ext/hls/gsthlsdemux.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index 23e07e6..86db8bd 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -675,6 +675,9 @@ gst_hls_demux_pause_tasks (GstHLSDemux * demux)
     demux->stop_stream_task = TRUE;
     g_cond_signal (&demux->download_cond);
     g_mutex_unlock (&demux->download_lock);
+    g_mutex_lock (&demux->fragment_download_lock);
+    g_cond_signal (&demux->fragment_download_cond);
+    g_mutex_unlock (&demux->fragment_download_lock);
     gst_task_pause (demux->stream_task);
   }
 }
@@ -1839,8 +1842,8 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
   /* wait for the fragment to be completely downloaded */
   g_cond_wait (&demux->fragment_download_cond, &demux->fragment_download_lock);
 
-  g_mutex_unlock (&demux->fragment_download_lock);
   gst_element_set_state (demux->src, GST_STATE_READY);
+  g_mutex_unlock (&demux->fragment_download_lock);
 
   return TRUE;
 }

_______________________________________________
gstreamer-commits mailing list
gstreamer-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic