hls_stream->playlist = NULL;
}
+ if (hls_stream->init_file) {
+ gst_m3u8_init_file_unref (hls_stream->init_file);
+ hls_stream->init_file = NULL;
+ }
+
if (hls_stream->pending_encrypted_data)
g_object_unref (hls_stream->pending_encrypted_data);
discont = file->discont || stream->discont;
- if (GST_ADAPTIVE_DEMUX2_STREAM_NEED_HEADER (stream) && file->init_file) {
+ gboolean need_header = GST_ADAPTIVE_DEMUX2_STREAM_NEED_HEADER (stream);
+
+ /* Check if the MAP header file changed and update it */
+ if (file->init_file != NULL
+ && !gst_m3u8_init_file_equal (hlsdemux_stream->init_file,
+ file->init_file)) {
+ GST_DEBUG_OBJECT (stream, "MAP header info changed. Updating");
+ if (hlsdemux_stream->init_file != NULL)
+ gst_m3u8_init_file_unref (hlsdemux_stream->init_file);
+ hlsdemux_stream->init_file = gst_m3u8_init_file_ref (file->init_file);
+ need_header = TRUE;
+ }
+
+ if (file->init_file && need_header) {
GstM3U8InitFile *header_file = file->init_file;
g_free (stream->fragment.header_uri);
stream->fragment.header_uri = g_strdup (header_file->uri);
} else {
stream->fragment.header_range_end = -1;
}
+
+ stream->need_header = TRUE;
}
/* set up our source for download */
/* The media playlist currently used */
GstHLSMediaPlaylist *playlist;
+ /* The current header / init_file data */
+ GstM3U8InitFile *init_file;
+
/* The segment (from the above playlist) currently being used */
GstM3U8MediaSegment *current_segment;