return gst_pad_event_default (pad, parent, event);
}
-static void
+static gboolean
gst_dash_demux_setup_mpdparser_streams (GstDashDemux * demux,
GstMpdClient * client)
{
GList *listLang = NULL;
guint i, nb_audio;
gchar *lang;
+ gboolean has_streams = FALSE;
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_VIDEO, ""))
GST_INFO_OBJECT (demux, "No video adaptation set found");
+ else
+ has_streams = TRUE;
nb_audio =
gst_mpdparser_get_list_and_nb_of_audio_language (client, &listLang);
gst_mpdparser_get_nb_adaptationSet (client));
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_AUDIO, lang))
GST_INFO_OBJECT (demux, "No audio adaptation set found");
+ else
+ has_streams = TRUE;
- if (gst_mpdparser_get_nb_adaptationSet (client) > nb_audio)
+ if (gst_mpdparser_get_nb_adaptationSet (client) > nb_audio) {
if (!gst_mpd_client_setup_streaming (client,
- GST_STREAM_APPLICATION, lang))
+ GST_STREAM_APPLICATION, lang)) {
GST_INFO_OBJECT (demux, "No application adaptation set found");
+ } else {
+ has_streams = TRUE;
+ }
+ }
+ }
+ if (!has_streams) {
+ GST_ELEMENT_ERROR (demux, STREAM, DEMUX, ("Manifest has no playable "
+ "streams"), ("No streams could be activated from the manifest"));
}
+ return has_streams;
}
static gboolean
/* clean old active stream list, if any */
gst_active_streams_free (demux->client);
- gst_dash_demux_setup_mpdparser_streams (demux, demux->client);
+ if (!gst_dash_demux_setup_mpdparser_streams (demux, demux->client)) {
+ return FALSE;
+ }
GST_DEBUG_OBJECT (demux, "Creating stream objects");
for (i = 0; i < gst_mpdparser_get_nb_active_stream (demux->client); i++) {
break;
}
} else {
- GST_DEBUG_OBJECT (demux, "Non buffers have preference %p", item->object);
+ GST_DEBUG_OBJECT (demux, "Non buffers have preference %" GST_PTR_FORMAT, item->object);
selected_stream = stream;
break;
}
}
}
- gst_dash_demux_setup_mpdparser_streams (demux, new_client);
+ if (!gst_dash_demux_setup_mpdparser_streams (demux, new_client)) {
+ GST_ERROR_OBJECT (demux, "Failed to setup streams on manifest "
+ "update");
+ return GST_FLOW_ERROR;
+ }
/* update the streams to play from the next segment */
for (iter = demux->streams; iter; iter = g_slist_next (iter)) {
demux->client->update_failed_count = 0;
quit:
+ GST_DEBUG_OBJECT (demux, "Finishing download loop");
return;
cancelled: