From: Guillaume Desmottes Date: Wed, 13 Jul 2016 14:02:25 +0000 (+0200) Subject: playbin3: fix leaks of collection returned by message parse API X-Git-Tag: 1.19.3~511^2~2756 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1d55f29a1a7a5de6e43c21d08991b305fedd788;p=platform%2Fupstream%2Fgstreamer.git playbin3: fix leaks of collection returned by message parse API gst_message_parse_stream_collection() and gst_message_parse_streams_selected() actually return a reffed GstStreamCollection. https://bugzilla.gnome.org/show_bug.cgi?id=768776 --- diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c index 1cdcc83..ae1923c 100644 --- a/gst/playback/gstdecodebin3.c +++ b/gst/playback/gstdecodebin3.c @@ -1182,6 +1182,8 @@ gst_decodebin3_handle_message (GstBin * bin, GstMessage * message) gst_message_unref (message); message = new_msg; } + if (collection) + gst_object_unref (collection); break; } default: diff --git a/gst/playback/gstplaybin3.c b/gst/playback/gstplaybin3.c index 7a3f163..a68a722 100644 --- a/gst/playback/gstplaybin3.c +++ b/gst/playback/gstplaybin3.c @@ -3102,6 +3102,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg) GST_PLAY_BIN3_UNLOCK (playbin); notify_all_streams (playbin, collection); + gst_object_unref (collection); } } else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAMS_SELECTED) { GstStreamCollection *collection = NULL; @@ -3138,6 +3139,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg) GST_PLAY_BIN3_UNLOCK (playbin); notify_all_streams (playbin, collection); + gst_object_unref (collection); } } diff --git a/tests/examples/decodebin_next/decodebin3.c b/tests/examples/decodebin_next/decodebin3.c index 2eb2a68..53a8249 100644 --- a/tests/examples/decodebin_next/decodebin3.c +++ b/tests/examples/decodebin_next/decodebin3.c @@ -223,6 +223,7 @@ _on_bus_message (GstBus * bus, GstMessage * message, MyDataStruct * data) /* In 5s try to change streams */ data->timeout_id = g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data); + gst_object_unref (collection); } break; } diff --git a/tests/examples/decodebin_next/playbin-test.c b/tests/examples/decodebin_next/playbin-test.c index d8e9a88..38a328c 100644 --- a/tests/examples/decodebin_next/playbin-test.c +++ b/tests/examples/decodebin_next/playbin-test.c @@ -217,6 +217,7 @@ _on_bus_message (GstBus * bus, GstMessage * message, MyDataStruct * data) /* In 5s try to change streams */ data->timeout_id = g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data); + gst_object_unref (collection); } break; }