gst_adaptive_demux_track_unref (track);
}
+ if (variant_caps)
+ gst_caps_unref (variant_caps);
+
/* Update the stream object with rendition types.
* FIXME: rendition_type could be removed */
stream->stream_type = hlsdemux_stream->rendition_type;
/* Is this rendition active in the current variant ? */
if (!g_strcmp0 (playlist->media_groups[media->mtype], media->group_id)) {
GST_DEBUG_OBJECT (demux, "Enabling rendition");
+ if (media_stream->current_rendition)
+ gst_hls_rendition_stream_unref (media_stream->current_rendition);
media_stream->current_rendition = gst_hls_rendition_stream_ref (media);
}
streams = g_list_append (streams, media_stream);
}
+ /* Free the list (but not the contents, which are stored
+ * elsewhere */
+ if (streams)
+ g_list_free (streams);
create_main_variant_stream (hlsdemux);
return FALSE;
}
+ if (hlsdemux->master) {
+ gst_hls_master_playlist_unref (hlsdemux->master);
+ hlsdemux->master = NULL;
+ }
hlsdemux->master = gst_hls_master_playlist_new_from_data (playlist,
gst_adaptive_demux_get_manifest_ref_uri (demux));
if (hls_stream == hlsdemux->main_stream)
hlsdemux->main_stream = NULL;
+ g_free (hls_stream->lang);
+ g_free (hls_stream->name);
+
if (hls_stream->playlist) {
gst_hls_media_playlist_unref (hls_stream->playlist);
hls_stream->playlist = NULL;
gst_buffer_replace (&hls_stream->pending_typefind_buffer, NULL);
gst_buffer_replace (&hls_stream->pending_segment_data, NULL);
+ if (hls_stream->moov)
+ gst_isoff_moov_box_free (hls_stream->moov);
+
if (hls_stream->current_key) {
g_free (hls_stream->current_key);
hls_stream->current_key = NULL;
if (GST_ADAPTIVE_DEMUX2_STREAM_NEED_HEADER (stream) && file->init_file) {
GstM3U8InitFile *header_file = file->init_file;
+ g_free (stream->fragment.header_uri);
stream->fragment.header_uri = g_strdup (header_file->uri);
stream->fragment.header_range_start = header_file->offset;
if (header_file->size != -1) {
{
g_assert (media != NULL && media->ref_count > 0);
if (g_atomic_int_dec_and_test (&media->ref_count)) {
+ if (media->caps)
+ gst_caps_unref (media->caps);
g_free (media->group_id);
g_free (media->name);
g_free (media->uri);
hls_master_playlist_unref (GstHLSMasterPlaylist * playlist)
{
if (g_atomic_int_dec_and_test (&playlist->refcount)) {
+ g_list_free_full (playlist->renditions,
+ (GDestroyNotify) gst_hls_rendition_stream_unref);
g_list_free_full (playlist->variants,
(GDestroyNotify) gst_hls_variant_stream_unref);
g_list_free_full (playlist->iframe_variants,
GST_PTR_FORMAT, media->caps);
} else {
GST_DEBUG (" Assigning caps %" GST_PTR_FORMAT, media_caps);
- media->caps = gst_caps_ref (media_caps);
+ gst_caps_replace (&media->caps, media_caps);
}
}
}
if (!alt_in_variant) {
GstCaps *new_caps = gst_caps_subtract (stream->caps, media_caps);
gst_caps_replace (&stream->caps, new_caps);
+ gst_caps_unref (new_caps);
}
gst_caps_unref (media_caps);
}
if (!res) {
res = gst_caps_copy (stream->caps);
} else {
- res = gst_caps_merge_common (res, stream->caps);
+ GstCaps *common_caps = gst_caps_merge_common (res, stream->caps);
+ gst_caps_unref (res);
+ res = common_caps;
if (!res)
goto beach;
}