From cb30cd242ca5084df9eaee2154bb80a740c4a7ed Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Fri, 26 Aug 2011 21:46:06 +0000 Subject: [PATCH] hlsdemux: do not broadcast the fetcher_cond on bus error if we're cancelled If we cancel the fetch and call the stop_fetcher, which holds the lock, when it sets the fetcher's state to NULL, it might send an error on the bus. In that case, we must ignore it, otherwise it will try to take the lock and will block forever. --- gst/hls/gsthlsdemux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c index d0331bf69a..9b6f99a61d 100644 --- a/gst/hls/gsthlsdemux.c +++ b/gst/hls/gsthlsdemux.c @@ -787,9 +787,11 @@ gst_hls_demux_fetcher_bus_handler (GstBus * bus, if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) { demux->fetcher_error = TRUE; - g_mutex_lock (demux->fetcher_lock); - g_cond_broadcast (demux->fetcher_cond); - g_mutex_unlock (demux->fetcher_lock); + if (!demux->cancelled) { + g_mutex_lock (demux->fetcher_lock); + g_cond_broadcast (demux->fetcher_cond); + g_mutex_unlock (demux->fetcher_lock); + } } gst_message_unref (message);