adaptivedemux2: Fix collection leaks

* The collection on the period was never unreffed
* The collection in the message handler was never unreffed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
This commit is contained in:
Edward Hervey 2022-10-31 16:08:23 +01:00 committed by GStreamer Marge Bot
parent 93d8b3f660
commit 7f86e925e2
2 changed files with 5 additions and 0 deletions

View file

@ -53,6 +53,9 @@ _demux_period_free (GstAdaptiveDemuxPeriod * period)
/* Disable and remove all streams and tracks. */
g_list_free_full (period->streams, (GDestroyNotify) gst_object_unref);
if (period->collection)
gst_object_unref (period->collection);
/* Theoretically all tracks should have gone by now */
GST_DEBUG ("Disabling and removing all tracks");
g_list_free_full (period->tracks,

View file

@ -1509,6 +1509,8 @@ gst_adaptive_demux_handle_stream_collection_msg (GstAdaptiveDemux * demux,
beach:
GST_MANIFEST_UNLOCK (demux);
if (collection)
gst_object_unref (collection);
gst_message_unref (msg);
msg = NULL;
}