adaptivedemux: check if element exists before setting it to null

Under certain error conditions it might happen that the element
has been freed already and trying to set it to NULL causes an
assertion
This commit is contained in:
Thiago Santos 2014-12-23 01:51:50 -03:00
parent 3dfab51b92
commit c65aeedb6f

View file

@ -1061,7 +1061,8 @@ gst_adaptive_demux_stop_tasks (GstAdaptiveDemux * demux)
GstAdaptiveDemuxStream *stream = iter->data;
gst_task_stop (stream->download_task);
gst_element_set_state (stream->src, GST_STATE_READY);
if (stream->src)
gst_element_set_state (stream->src, GST_STATE_READY);
g_mutex_lock (&stream->fragment_download_lock);
stream->download_finished = TRUE;
g_cond_signal (&stream->fragment_download_cond);