From 0e132260a334a179d89f623aaa2414f8ecde7f19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 16 Jan 2016 10:47:36 +0100 Subject: [PATCH] output-selector: Notify when the active-pad property is changing --- plugins/elements/gstoutputselector.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c index beb4c70..c2b810b 100644 --- a/plugins/elements/gstoutputselector.c +++ b/plugins/elements/gstoutputselector.c @@ -337,6 +337,7 @@ gst_output_selector_request_new_pad (GstElement * element, /* Set the first requested src pad as active by default */ if (osel->active_srcpad == NULL) { osel->active_srcpad = srcpad; + g_object_notify (G_OBJECT (osel), "active-pad"); } g_free (padname); @@ -352,6 +353,12 @@ gst_output_selector_release_pad (GstElement * element, GstPad * pad) GST_DEBUG_OBJECT (osel, "releasing pad"); + /* Disable active pad if it's the to be removed pad */ + if (osel->active_srcpad == pad) { + osel->active_srcpad = NULL; + g_object_notify (G_OBJECT (osel), "active-pad"); + } + gst_pad_set_active (pad, FALSE); gst_element_remove_pad (GST_ELEMENT_CAST (osel), pad); @@ -379,6 +386,7 @@ gst_output_selector_switch (GstOutputSelector * osel) /* Send SEGMENT event and latest buffer if switching succeeded * and we already have a valid segment configured */ if (res) { + g_object_notify (G_OBJECT (osel), "active-pad"); gst_pad_sticky_events_foreach (osel->sinkpad, forward_sticky_events, osel->active_srcpad); -- 2.7.4