adaptivedemux: On EOS, handle it before waking download loop

Otherwise, if the download loop wakes too quickly, it
might miss the last_ret value update from the processing
thread and loop again.
This commit is contained in:
Jan Schmidt 2016-08-04 04:29:38 +10:00
parent 2df53e5a7d
commit 07f49f15b1

View file

@ -2306,13 +2306,13 @@ _src_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_EOS:{
GST_MANIFEST_LOCK (demux);
gst_adaptive_demux_eos_handling (stream);
g_mutex_lock (&stream->fragment_download_lock);
stream->download_finished = TRUE;
g_cond_signal (&stream->fragment_download_cond);
g_mutex_unlock (&stream->fragment_download_lock);
gst_adaptive_demux_eos_handling (stream);
GST_MANIFEST_UNLOCK (demux);
break;
}