From 12a905929f239eb8fe111527d2244d19c6a97efa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 23 Dec 2014 12:54:50 +0100 Subject: [PATCH] inputselector: Keep a ref of the currently active sinkpad around Otherwise we can't be sure that the pointer points to a still existing pad instance after releasing the lock. --- plugins/elements/gstinputselector.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index e497dc2..23ffb1e 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -453,6 +453,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) prev_active_sinkpad = sel->active_sinkpad ? gst_object_ref (sel->active_sinkpad) : NULL; active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad); + gst_object_ref (active_sinkpad); GST_INPUT_SELECTOR_UNLOCK (sel); if (prev_active_sinkpad != active_sinkpad) { @@ -463,6 +464,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) } if (prev_active_sinkpad) gst_object_unref (prev_active_sinkpad); + gst_object_unref (active_sinkpad); GST_INPUT_SELECTOR_LOCK (sel); active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad); -- 2.7.4