composition: simplify update_pipeline_func
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Fri, 27 Jun 2014 13:00:48 +0000 (15:00 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 31 Oct 2014 10:58:07 +0000 (11:58 +0100)
gnl/gnlcomposition.c

index 2890537..ac58804 100644 (file)
@@ -1881,28 +1881,22 @@ update_pipeline_func (GnlComposition * comp)
 
   seek_handling (comp, TRUE, TRUE);
 
-  if (!priv->current) {
-    /* If we're at the end, post SEGMENT_DONE, or push EOS */
-    GST_DEBUG_OBJECT (comp, "Nothing else to play");
-
-    if (!(priv->segment->flags & GST_SEEK_FLAG_SEGMENT)) {
-      GST_DEBUG_OBJECT (comp, "Real EOS should be sent now");
-    } else if (priv->segment->flags & GST_SEEK_FLAG_SEGMENT) {
-      gint64 epos;
-
-      if (GST_CLOCK_TIME_IS_VALID (priv->segment->stop))
-        epos = (MIN (priv->segment->stop, GNL_OBJECT_STOP (comp)));
-      else
-        epos = GNL_OBJECT_STOP (comp);
-
-      GST_LOG_OBJECT (comp, "Emitting segment done pos %" GST_TIME_FORMAT,
-          GST_TIME_ARGS (epos));
-      gst_element_post_message (GST_ELEMENT_CAST (comp),
-          gst_message_new_segment_done (GST_OBJECT (comp),
-              priv->segment->format, epos));
-      gst_pad_push_event (GNL_OBJECT (comp)->srcpad,
-          gst_event_new_segment_done (priv->segment->format, epos));
-    }
+  /* Post segment done if last seek was a segment seek */
+  if (!priv->current && (priv->segment->flags & GST_SEEK_FLAG_SEGMENT)) {
+    gint64 epos;
+
+    if (GST_CLOCK_TIME_IS_VALID (priv->segment->stop))
+      epos = (MIN (priv->segment->stop, GNL_OBJECT_STOP (comp)));
+    else
+      epos = GNL_OBJECT_STOP (comp);
+
+    GST_LOG_OBJECT (comp, "Emitting segment done pos %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (epos));
+    gst_element_post_message (GST_ELEMENT_CAST (comp),
+        gst_message_new_segment_done (GST_OBJECT (comp),
+          priv->segment->format, epos));
+    gst_pad_push_event (GNL_OBJECT (comp)->srcpad,
+        gst_event_new_segment_done (priv->segment->format, epos));
   }