dashdemux: fix extraction of SegmentTemplate->initialization in gst_mpd_client_get_next_header()

now the following MPD files are properly supported:

http://dash.edgesuite.net/adobe/hdworld_dash/HDWorld-1600.mpd
http://dash.edgesuite.net/adobe/hdworld_dash/HDWorld.mpd
This commit is contained in:
Gianluca Gennari 2012-10-17 18:42:02 +02:00 committed by Thiago Santos
parent cd84aaa9aa
commit 3726ff73ad

View file

@ -2800,7 +2800,6 @@ gst_mpd_client_get_next_header (GstMpdClient * client, const gchar **uri, guint
/* select stream */ /* select stream */
g_return_val_if_fail (client != NULL, FALSE); g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (client->active_streams != NULL, FALSE); g_return_val_if_fail (client->active_streams != NULL, FALSE);
/* TODO: support multiple streams */
stream = g_list_nth_data (client->active_streams, stream_idx); stream = g_list_nth_data (client->active_streams, stream_idx);
g_return_val_if_fail (stream != NULL, FALSE); g_return_val_if_fail (stream != NULL, FALSE);
g_return_val_if_fail (stream->cur_representation != NULL, FALSE); g_return_val_if_fail (stream->cur_representation != NULL, FALSE);
@ -2812,7 +2811,15 @@ gst_mpd_client_get_next_header (GstMpdClient * client, const gchar **uri, guint
if (stream->cur_segment_base && stream->cur_segment_base->Initialization) { if (stream->cur_segment_base && stream->cur_segment_base->Initialization) {
*uri = gst_mpdparser_get_initializationURL(stream->cur_segment_base->Initialization); *uri = gst_mpdparser_get_initializationURL(stream->cur_segment_base->Initialization);
} else if (stream->cur_seg_template) { } else if (stream->cur_seg_template) {
*uri = gst_mpdparser_build_URL_from_template (stream->cur_seg_template->initialization, const gchar *initialization = NULL;
if (stream->cur_seg_template->initialization) {
initialization = stream->cur_seg_template->initialization;
} else if (stream->cur_adapt_set->SegmentTemplate && stream->cur_adapt_set->SegmentTemplate->initialization) {
initialization = stream->cur_adapt_set->SegmentTemplate->initialization;
} else if (client->cur_period->SegmentTemplate && client->cur_period->SegmentTemplate->initialization) {
initialization = client->cur_period->SegmentTemplate->initialization;
}
*uri = gst_mpdparser_build_URL_from_template (initialization,
stream->cur_representation->id, 0, stream->cur_representation->bandwidth, 0); stream->cur_representation->id, 0, stream->cur_representation->bandwidth, 0);
} }
GST_MPD_CLIENT_UNLOCK (client); GST_MPD_CLIENT_UNLOCK (client);