composition: simplify update_pipeline_func

This commit is contained in:
Mathieu Duponchelle 2014-06-27 15:00:48 +02:00 committed by Thibault Saunier
parent 9c10aa34d1
commit 13ae2cecd3

View file

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