From 46ac6a2589f4b40dadd9aa30b9a8dc5da47d484d Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Thu, 25 Aug 2011 23:37:47 +0000 Subject: [PATCH] hlsdemux: stop the threads in the proper order first pause the task, then stop all fetchers, then stop the update thread then pause the task again, since it might have been restarted by another thread in the meantime --- gst/hls/gsthlsdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c index 582507ab5f..14695d5663 100644 --- a/gst/hls/gsthlsdemux.c +++ b/gst/hls/gsthlsdemux.c @@ -375,13 +375,14 @@ gst_hls_demux_src_event (GstPad * pad, GstEvent * event) } demux->cancelled = TRUE; + gst_task_pause (demux->task); g_mutex_lock (demux->fetcher_lock); gst_hls_demux_stop_fetcher (demux, TRUE); g_mutex_unlock (demux->fetcher_lock); - gst_task_pause (demux->task); g_mutex_lock (demux->thread_lock); g_cond_signal (demux->thread_cond); g_mutex_unlock (demux->thread_lock); + gst_task_pause (demux->task); /* wait for streaming to finish */ g_static_rec_mutex_lock (&demux->task_lock);