input-selector: Fix missing pad activation notification

A new active pad might not be notified in some cases, which results
in the current track number not being set in playbin.

The active-pad notification is only sent in the chain and sink_event
functions, and only when the buffer or event that triggered the active
pad selection is from the newly activated pad. So in the other case
the notification will never be sent.

https://bugzilla.gnome.org/show_bug.cgi?id=704691
This commit is contained in:
Arnaud Vrac 2013-07-22 18:03:01 +02:00 committed by Sebastian Dröge
parent 0c513e3d97
commit 9bc26c5f25

View file

@ -461,7 +461,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) {
if (prev_active_sinkpad != active_sinkpad) {
if (prev_active_sinkpad)
g_object_notify (G_OBJECT (prev_active_sinkpad), "active");
g_object_notify (G_OBJECT (active_sinkpad), "active");
@ -1050,7 +1050,7 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) {
if (prev_active_sinkpad != active_sinkpad) {
if (prev_active_sinkpad)
g_object_notify (G_OBJECT (prev_active_sinkpad), "active");
g_object_notify (G_OBJECT (active_sinkpad), "active");