diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-12-23 17:08:27 +0100 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-12-23 17:08:27 +0100 |
commit | 3b0fc1e4fb8caaf203b7af0188a0cbed807fc408 (patch) | |
tree | b8a9d7e10a9368c760eb588a99b8730156cc264a | |
parent | d4e1ff012d285d055598a4b66570c6a33c08dcaa (diff) |
playbin2: avoid leaking selector request pads
-rw-r--r-- | gst/playback/gstplaybin2.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index d8adb49c..a9f71f2e 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; |