dashdemux: Fix critical error output when Initialization has no URL

Issue evinced by
http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-manifest.mpd
which produces output like ** (gst-launch-1.0:8060): CRITICAL **:
gst_mpdparser_get_initializationURL: assertion `InitializationURL->sourceURL
!= NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=700489
This commit is contained in:
Arthur Shipkowski 2013-05-06 17:08:54 -04:00 committed by Thiago Santos
parent d9c324c6c7
commit 54d87f071c

View file

@ -116,8 +116,8 @@ static gchar *gst_mpdparser_parse_baseURL (GstMpdClient * client,
GstActiveStream * stream, gchar ** query); GstActiveStream * stream, gchar ** query);
static gchar *gst_mpdparser_get_mediaURL (GstActiveStream * stream, static gchar *gst_mpdparser_get_mediaURL (GstActiveStream * stream,
GstSegmentURLNode * segmentURL); GstSegmentURLNode * segmentURL);
static gchar *gst_mpdparser_get_initializationURL (GstURLType * static const gchar *gst_mpdparser_get_initializationURL (
InitializationURL); GstActiveStream * stream, GstURLType * InitializationURL);
static gchar *gst_mpdparser_build_URL_from_template (const gchar * url_template, static gchar *gst_mpdparser_build_URL_from_template (const gchar * url_template,
const gchar * id, guint number, guint bandwidth, guint64 time); const gchar * id, guint number, guint bandwidth, guint64 time);
static gboolean gst_mpd_client_add_media_segment (GstActiveStream * stream, static gboolean gst_mpd_client_add_media_segment (GstActiveStream * stream,
@ -2368,13 +2368,19 @@ gst_mpdparser_get_mediaURL (GstActiveStream * stream,
return segmentURL->media; return segmentURL->media;
} }
static gchar * static const gchar *
gst_mpdparser_get_initializationURL (GstURLType * InitializationURL) gst_mpdparser_get_initializationURL (GstActiveStream * stream,
GstURLType * InitializationURL)
{ {
g_return_val_if_fail (InitializationURL != NULL, NULL); const gchar *url_prefix;
g_return_val_if_fail (InitializationURL->sourceURL != NULL, NULL);
return InitializationURL->sourceURL; g_return_val_if_fail (stream != NULL, NULL);
g_return_val_if_fail (InitializationURL != NULL, NULL);
url_prefix = InitializationURL->sourceURL ? InitializationURL->sourceURL :
stream->baseURL;
return url_prefix;
} }
static gchar * static gchar *
@ -3363,7 +3369,7 @@ gst_mpd_client_get_next_header (GstMpdClient * client, gchar ** uri,
*uri = NULL; *uri = NULL;
if (stream->cur_segment_base && stream->cur_segment_base->Initialization) { if (stream->cur_segment_base && stream->cur_segment_base->Initialization) {
*uri = *uri =
g_strdup (gst_mpdparser_get_initializationURL (stream->cur_segment_base-> g_strdup (gst_mpdparser_get_initializationURL (stream, stream->cur_segment_base->
Initialization)); Initialization));
if (stream->cur_segment_base->Initialization->range) { if (stream->cur_segment_base->Initialization->range) {
*range_start = *range_start =