input-selector: Use segment-presence for running_time check
authorJan Alexander Steffens (heftig) <jsteffens@make.tv>
Wed, 19 Nov 2014 11:59:12 +0000 (12:59 +0100)
committerThiago Santos <thiagoss@osg.samsung.com>
Tue, 24 Mar 2015 13:34:27 +0000 (10:34 -0300)
When determining whether the running_time of a pad can be
calculated, check if the segment is in TIME format instead
of using the 'active' field.

Since the latter is set through *any* activity, it's not a
reliable indicator of segment presence.

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

plugins/elements/gstinputselector.c

index cd2922d..d1faeba 100644 (file)
@@ -323,7 +323,7 @@ gst_selector_pad_get_running_time (GstSelectorPad * pad)
   gint64 ret = 0;
 
   GST_OBJECT_LOCK (pad);
-  if (pad->active) {
+  if (pad->segment.format == GST_FORMAT_TIME) {
     ret =
         gst_segment_to_running_time (&pad->segment, pad->segment.format,
         pad->segment.position);