summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-12-23 12:54:50 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-23 12:54:50 +0100
commit12a905929f239eb8fe111527d2244d19c6a97efa (patch)
treefa8c60245608a09d0828453c84093c348dcf60ba /plugins
parent3137043c3a63748a882409dd75ab9706b7f3b09c (diff)
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstinputselector.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index e497dc243..23ffb1efb 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);