for (iter = mssdemux->streams; iter; iter = g_slist_next (iter)) {
GstMssDemuxStream *stream = iter->data;
- gst_element_remove_pad (GST_ELEMENT_CAST (mssdemux), stream->pad);
+ if (stream->pad)
+ gst_element_remove_pad (GST_ELEMENT_CAST (mssdemux), stream->pad);
gst_mss_demux_stream_free (stream);
}
g_slist_free (mssdemux->streams);
GstMssDemuxStream *stream = iter->data;
iter = g_slist_next (iter); /* do it ourselves as we want it done in the beginning of the loop */
if (!gst_mss_demux_expose_stream (mssdemux, stream)) {
+ if (stream->pad)
+ gst_element_remove_pad (GST_ELEMENT_CAST (mssdemux), stream->pad);
gst_mss_demux_stream_free (stream);
mssdemux->streams = g_slist_delete_link (mssdemux->streams, current);
}
GstPad *oldpad = stream->pad;
GstClockTime ts = GST_CLOCK_TIME_NONE;
- oldpads = g_slist_prepend (oldpads, oldpad);
+ if (oldpad)
+ oldpads = g_slist_prepend (oldpads, oldpad);
/* since we are flushing the queue, get the next un-pushed timestamp to seek
* and avoid gaps */
stream->pad = _create_pad (mssdemux, stream->manifest_stream);
gst_mss_demux_expose_stream (mssdemux, stream);
- gst_pad_push_event (oldpad, gst_event_new_eos ());
stream->have_data = FALSE;
}
for (iter = oldpads; iter; iter = g_slist_next (iter)) {
GstPad *oldpad = iter->data;
+ gst_pad_push_event (oldpad, gst_event_new_eos ());
gst_pad_set_active (oldpad, FALSE);
gst_element_remove_pad (GST_ELEMENT (mssdemux), oldpad);
gst_object_unref (oldpad);