- for (iter = mssdemux->streams; iter; iter = g_slist_next (iter)) {
- gst_mss_demux_expose_stream (mssdemux, iter->data);
+ for (iter = mssdemux->streams; iter;) {
+ GSList *current = iter;
+ 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)) {
+ gst_mss_demux_stream_free (stream);
+ mssdemux->streams = g_slist_delete_link (mssdemux->streams, current);
+ }
+ }
+
+ if (!mssdemux->streams) {
+ /* no streams */
+ GST_WARNING_OBJECT (mssdemux, "Couldn't identify the caps for any of the "
+ "streams found in the manifest");
+ GST_ELEMENT_ERROR (mssdemux, STREAM, DEMUX,
+ (_("This file contains no playable streams.")),
+ ("No known stream formats found at the Manifest"));
+ return;