From 96613c45fb45b49ad118589dd9a6e2bf53d76dbf Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 25 Jan 2023 10:08:50 +0100 Subject: [PATCH] adaptivedemux2: Don't leak taglist Clarify the ownership in the documentation Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/dash/gstdashdemux.c | 6 +++--- .../gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c | 1 + .../gst-plugins-good/ext/adaptivedemux2/mss/gstmssdemux.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstdashdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstdashdemux.c index 3d0b5624e5..0d277539cf 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstdashdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstdashdemux.c @@ -879,6 +879,9 @@ gst_dash_demux_setup_all_streams (GstDashDemux2 * demux) GST_ADAPTIVE_DEMUX2_STREAM_CAST (stream)->stream_type = streamtype; g_free (stream_id); + if (tags) + gst_adaptive_demux2_stream_set_tags (GST_ADAPTIVE_DEMUX2_STREAM_CAST + (stream), gst_tag_list_ref (tags)); gst_adaptive_demux2_add_stream (GST_ADAPTIVE_DEMUX_CAST (demux), GST_ADAPTIVE_DEMUX2_STREAM_CAST (stream)); @@ -901,9 +904,6 @@ gst_dash_demux_setup_all_streams (GstDashDemux2 * demux) || gst_structure_has_name (s, "audio/x-m4a"); gst_adaptive_demux2_stream_set_caps (GST_ADAPTIVE_DEMUX2_STREAM_CAST (stream), caps); - if (tags) - gst_adaptive_demux2_stream_set_tags (GST_ADAPTIVE_DEMUX2_STREAM_CAST - (stream), tags); stream->index = i; if (active_stream->cur_adapt_set && diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c index d389afdbaf..371786ebc1 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c @@ -2896,6 +2896,7 @@ gst_adaptive_demux2_stream_set_caps (GstAdaptiveDemux2Stream * stream, } /* must be called with manifest_lock taken */ +/* @tags: transfer full */ void gst_adaptive_demux2_stream_set_tags (GstAdaptiveDemux2Stream * stream, GstTagList * tags) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/mss/gstmssdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/mss/gstmssdemux.c index 186e029850..846d6ae7bd 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/mss/gstmssdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/mss/gstmssdemux.c @@ -431,6 +431,9 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux) if (lang != NULL) tags = gst_tag_list_new (GST_TAG_LANGUAGE_CODE, lang, NULL); + if (tags) + gst_adaptive_demux2_stream_set_tags (stream, gst_tag_list_ref (tags)); + track = gst_adaptive_demux_track_new (demux, stream_type, GST_STREAM_FLAG_NONE, (gchar *) stream_id, create_mss_caps (mss_stream, caps), tags); @@ -443,9 +446,6 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux) GST_DEBUG_OBJECT (stream, "Current quality bitrate %" G_GUINT64_FORMAT, gst_mss_stream_get_current_bitrate (manifeststream)); - if (tags) - gst_adaptive_demux2_stream_set_tags (stream, tags); - active_streams = g_slist_prepend (active_streams, mss_stream); }