GstActiveStream * stream, gchar ** query);
static gchar *gst_mpdparser_get_mediaURL (GstActiveStream * stream,
GstSegmentURLNode * segmentURL);
-static gchar *gst_mpdparser_get_initializationURL (GstURLType *
- InitializationURL);
+static const gchar *gst_mpdparser_get_initializationURL (
+ GstActiveStream * stream, GstURLType * InitializationURL);
static gchar *gst_mpdparser_build_URL_from_template (const gchar * url_template,
const gchar * id, guint number, guint bandwidth, guint64 time);
static gboolean gst_mpd_client_add_media_segment (GstActiveStream * stream,
return segmentURL->media;
}
-static gchar *
-gst_mpdparser_get_initializationURL (GstURLType * InitializationURL)
+static const gchar *
+gst_mpdparser_get_initializationURL (GstActiveStream * stream,
+ GstURLType * InitializationURL)
{
+ const gchar *url_prefix;
+
+ g_return_val_if_fail (stream != NULL, NULL);
g_return_val_if_fail (InitializationURL != NULL, NULL);
- g_return_val_if_fail (InitializationURL->sourceURL != NULL, NULL);
- return InitializationURL->sourceURL;
+ url_prefix = InitializationURL->sourceURL ? InitializationURL->sourceURL :
+ stream->baseURL;
+
+ return url_prefix;
}
static gchar *
*uri = NULL;
if (stream->cur_segment_base && stream->cur_segment_base->Initialization) {
*uri =
- g_strdup (gst_mpdparser_get_initializationURL (stream->cur_segment_base->
+ g_strdup (gst_mpdparser_get_initializationURL (stream, stream->cur_segment_base->
Initialization));
if (stream->cur_segment_base->Initialization->range) {
*range_start =