From 12c268b7c5ed988666315718b4df789648222472 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 28 Jul 2016 15:44:27 +0200 Subject: [PATCH] decodebin_next: fix caps and tags leaks The getters are (transfer full). https://bugzilla.gnome.org/show_bug.cgi?id=769270 --- tests/examples/decodebin_next/decodebin3.c | 6 ++++-- tests/examples/decodebin_next/playbin-test.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/examples/decodebin_next/decodebin3.c b/tests/examples/decodebin_next/decodebin3.c index 53a8249..2b36239 100644 --- a/tests/examples/decodebin_next/decodebin3.c +++ b/tests/examples/decodebin_next/decodebin3.c @@ -79,8 +79,8 @@ static void dump_collection (GstStreamCollection * collection) { guint i; - const GstTagList *tags; - const GstCaps *caps; + GstTagList *tags; + GstCaps *caps; for (i = 0; i < gst_stream_collection_get_size (collection); i++) { GstStream *stream = gst_stream_collection_get_stream (collection, i); @@ -94,12 +94,14 @@ dump_collection (GstStreamCollection * collection) gchar *caps_str = gst_caps_to_string (caps); g_print (" caps: %s\n", caps_str); g_free (caps_str); + gst_caps_unref (caps); } tags = gst_stream_get_tags (stream); if (tags) { g_print (" tags:\n"); gst_tag_list_foreach (tags, print_tag_foreach, GUINT_TO_POINTER (3)); + gst_tag_list_unref (tags); } } } diff --git a/tests/examples/decodebin_next/playbin-test.c b/tests/examples/decodebin_next/playbin-test.c index 38a328c..f51b1fc 100644 --- a/tests/examples/decodebin_next/playbin-test.c +++ b/tests/examples/decodebin_next/playbin-test.c @@ -73,8 +73,8 @@ static void dump_collection (GstStreamCollection * collection) { guint i; - const GstTagList *tags; - const GstCaps *caps; + GstTagList *tags; + GstCaps *caps; for (i = 0; i < gst_stream_collection_get_size (collection); i++) { GstStream *stream = gst_stream_collection_get_stream (collection, i); @@ -88,12 +88,14 @@ dump_collection (GstStreamCollection * collection) gchar *caps_str = gst_caps_to_string (caps); g_print (" caps: %s\n", caps_str); g_free (caps_str); + gst_caps_unref (caps); } tags = gst_stream_get_tags (stream); if (tags) { g_print (" tags:\n"); gst_tag_list_foreach (tags, print_tag_foreach, GUINT_TO_POINTER (3)); + gst_tag_list_unref (tags); } } } -- 2.7.4