From 3b0fc1e4fb8caaf203b7af0188a0cbed807fc408 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 23 Dec 2009 17:08:27 +0100 Subject: [PATCH] playbin2: avoid leaking selector request pads --- gst/playback/gstplaybin2.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index d8adb49..a9f71f2 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3182,7 +3182,6 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target) else g_object_set (uridecodebin, "download", FALSE, NULL); - /* configure subtitle encoding */ g_object_set (uridecodebin, "subtitle-encoding", playbin->encoding, NULL); /* configure uri */ @@ -3368,6 +3367,17 @@ deactivate_group (GstPlayBin * playbin, GstSourceGroup * group) } if (select->selector) { + gint n; + + /* release and unref requests pad from the selector */ + for (n = 0; n < select->channels->len; n++) { + GstPad *sinkpad = g_ptr_array_index (select->channels, n); + + gst_element_release_request_pad (select->selector, sinkpad); + gst_object_unref (sinkpad); + } + g_ptr_array_set_size (select->channels, 0); + gst_element_set_state (select->selector, GST_STATE_NULL); gst_bin_remove (GST_BIN_CAST (playbin), select->selector); select->selector = NULL; -- 2.7.4