hlsdemux: Join the task instead of just stopping it and not waiting for it to finish

Fixes interesting race conditions that cause crashes in decodebin2
because pads are added/removed from child elements although they
should be in READY state already.
This commit is contained in:
Sebastian Dröge 2011-08-31 14:47:40 +02:00
parent c8b7ae1ffa
commit 119771eaab

View file

@ -664,8 +664,7 @@ gst_hls_demux_stop (GstHLSDemux * demux)
g_mutex_lock (demux->fetcher_lock);
gst_hls_demux_stop_fetcher_locked (demux, TRUE);
g_mutex_unlock (demux->fetcher_lock);
if (GST_TASK_STATE (demux->task) != GST_TASK_STOPPED)
gst_task_stop (demux->task);
gst_task_join (demux->task);
gst_hls_demux_stop_update (demux);
}