output-selector: Send all events to active src pad and EOS to all src pads
authorRavi Kiran K N <ravi.kiran@samsung.com>
Wed, 27 Aug 2014 11:36:57 +0000 (17:06 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 2 Sep 2014 09:33:56 +0000 (12:33 +0300)
Fixes tests/icles/output-selector-test

https://bugzilla.gnome.org/show_bug.cgi?id=729811

plugins/elements/gstoutputselector.c

index ec12e28..61e49a6 100644 (file)
@@ -534,29 +534,26 @@ gst_output_selector_event (GstPad * pad, GstObject * parent, GstEvent * event)
   sel = GST_OUTPUT_SELECTOR (parent);
 
   switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_EOS:
+    {
+      res = gst_output_selector_forward_event (sel, event);
+      break;
+    }
     case GST_EVENT_SEGMENT:
     {
       gst_event_copy_segment (event, &sel->segment);
-
       GST_DEBUG_OBJECT (sel, "configured SEGMENT %" GST_SEGMENT_FORMAT,
           &sel->segment);
-
-      res = gst_output_selector_forward_event (sel, event);
-      break;
+      /* fall through */
     }
     default:
     {
-      if (GST_EVENT_IS_STICKY (event)) {
-        res = gst_output_selector_forward_event (sel, event);
+      active = gst_output_selector_get_active (sel);
+      if (active) {
+        res = gst_pad_push_event (active, event);
+        gst_object_unref (active);
       } else {
-        /* Send other events to pending or active src pad */
-        active = gst_output_selector_get_active (sel);
-        if (active) {
-          res = gst_pad_push_event (active, event);
-          gst_object_unref (active);
-        } else {
-          gst_event_unref (event);
-        }
+        gst_event_unref (event);
       }
       break;
     }