input-selector: Fix missing pad activation notification
authorArnaud Vrac <avrac@freebox.fr>
Mon, 22 Jul 2013 16:03:01 +0000 (18:03 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 23 Jul 2013 06:59:07 +0000 (08:59 +0200)
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

plugins/elements/gstinputselector.c

index 2be30fe..7eda5a2 100644 (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");