summaryrefslogtreecommitdiffstats
path: root/gst/selector
diff options
context:
space:
mode:
authorMichael Smith <msmith@songbirdnest.com>2009-01-30 18:27:03 -0800
committerMichael Smith <msmith@songbirdnest.com>2009-01-30 18:29:01 -0800
commit6a0a9fc01e2aec4020b8f35b4a4ce5df8e60e9d7 (patch)
tree89b837f7d250860f05a48c412ab36a0f4366fdbf /gst/selector
parentf1f3dae7d98260a7fa52c7e070ea9b7ff62655ee (diff)
downloadgst-plugins-bad-6a0a9fc01e2aec4020b8f35b4a4ce5df8e60e9d7.tar.gz
gst-plugins-bad-6a0a9fc01e2aec4020b8f35b4a4ce5df8e60e9d7.tar.bz2
gst-plugins-bad-6a0a9fc01e2aec4020b8f35b4a4ce5df8e60e9d7.zip
Unref event if we don't forward it, unref pads when done with them.
Diffstat (limited to 'gst/selector')
-rw-r--r--gst/selector/gstinputselector.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c
index b55838ab..165d1f60 100644
--- a/gst/selector/gstinputselector.c
+++ b/gst/selector/gstinputselector.c
@@ -1038,6 +1038,8 @@ gst_input_selector_event (GstPad * pad, GstEvent * event)
gst_object_unref (otherpad);
}
+ else
+ gst_event_unref (event);
return res;
}
@@ -1191,6 +1193,8 @@ gst_input_selector_activate_sinkpad (GstInputSelector * sel, GstPad * pad)
if (active_sinkpad == NULL || sel->select_all) {
/* first pad we get activity on becomes the activated pad by default, if we
* select all, we also remember the last used pad. */
+ if (sel->active_sinkpad)
+ gst_object_unref (sel->active_sinkpad);
active_sinkpad = sel->active_sinkpad = gst_object_ref (pad);
GST_DEBUG_OBJECT (sel, "Activating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
}
@@ -1250,6 +1254,7 @@ gst_input_selector_release_pad (GstElement * element, GstPad * pad)
/* if the pad was the active pad, makes us select a new one */
if (sel->active_sinkpad == pad) {
GST_DEBUG_OBJECT (sel, "Deactivating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
+ gst_object_unref (sel->active_sinkpad);
sel->active_sinkpad = NULL;
}
sel->n_pads--;