mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
dashdemux: properly error out when manifest has no streams
Post an error message when the manifest is parsed and no valid streams are found be activated and used. Fixes #704308
This commit is contained in:
parent
646ba6b3df
commit
ac07f8577b
1 changed files with 27 additions and 6 deletions
|
@ -646,16 +646,19 @@ gst_dash_demux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||||
return gst_pad_event_default (pad, parent, event);
|
return gst_pad_event_default (pad, parent, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
gst_dash_demux_setup_mpdparser_streams (GstDashDemux * demux,
|
gst_dash_demux_setup_mpdparser_streams (GstDashDemux * demux,
|
||||||
GstMpdClient * client)
|
GstMpdClient * client)
|
||||||
{
|
{
|
||||||
GList *listLang = NULL;
|
GList *listLang = NULL;
|
||||||
guint i, nb_audio;
|
guint i, nb_audio;
|
||||||
gchar *lang;
|
gchar *lang;
|
||||||
|
gboolean has_streams = FALSE;
|
||||||
|
|
||||||
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_VIDEO, ""))
|
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_VIDEO, ""))
|
||||||
GST_INFO_OBJECT (demux, "No video adaptation set found");
|
GST_INFO_OBJECT (demux, "No video adaptation set found");
|
||||||
|
else
|
||||||
|
has_streams = TRUE;
|
||||||
|
|
||||||
nb_audio =
|
nb_audio =
|
||||||
gst_mpdparser_get_list_and_nb_of_audio_language (client, &listLang);
|
gst_mpdparser_get_list_and_nb_of_audio_language (client, &listLang);
|
||||||
|
@ -669,13 +672,24 @@ gst_dash_demux_setup_mpdparser_streams (GstDashDemux * demux,
|
||||||
gst_mpdparser_get_nb_adaptationSet (client));
|
gst_mpdparser_get_nb_adaptationSet (client));
|
||||||
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_AUDIO, lang))
|
if (!gst_mpd_client_setup_streaming (client, GST_STREAM_AUDIO, lang))
|
||||||
GST_INFO_OBJECT (demux, "No audio adaptation set found");
|
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,
|
if (!gst_mpd_client_setup_streaming (client,
|
||||||
GST_STREAM_APPLICATION, lang))
|
GST_STREAM_APPLICATION, lang)) {
|
||||||
GST_INFO_OBJECT (demux, "No application adaptation set found");
|
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
|
static gboolean
|
||||||
gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
||||||
|
@ -687,7 +701,9 @@ gst_dash_demux_setup_all_streams (GstDashDemux * demux)
|
||||||
/* clean old active stream list, if any */
|
/* clean old active stream list, if any */
|
||||||
gst_active_streams_free (demux->client);
|
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");
|
GST_DEBUG_OBJECT (demux, "Creating stream objects");
|
||||||
for (i = 0; i < gst_mpdparser_get_nb_active_stream (demux->client); i++) {
|
for (i = 0; i < gst_mpdparser_get_nb_active_stream (demux->client); i++) {
|
||||||
|
@ -1216,7 +1232,7 @@ gst_dash_demux_stream_loop (GstDashDemux * demux)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
selected_stream = stream;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1534,7 +1550,11 @@ gst_dash_demux_refresh_mpd (GstDashDemux * demux)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 */
|
/* update the streams to play from the next segment */
|
||||||
for (iter = demux->streams; iter; iter = g_slist_next (iter)) {
|
for (iter = demux->streams; iter; iter = g_slist_next (iter)) {
|
||||||
|
@ -1735,6 +1755,7 @@ gst_dash_demux_download_loop (GstDashDemux * demux)
|
||||||
demux->client->update_failed_count = 0;
|
demux->client->update_failed_count = 0;
|
||||||
|
|
||||||
quit:
|
quit:
|
||||||
|
GST_DEBUG_OBJECT (demux, "Finishing download loop");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cancelled:
|
cancelled:
|
||||||
|
|
Loading…
Reference in a new issue