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.
This commit is contained in:
Youness Alaoui 2011-08-26 21:46:06 +00:00 committed by Sebastian Dröge
parent fc0fe37b10
commit cb30cd242c

View file

@ -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);