inputselector: handle more formats
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 16 May 2011 14:59:20 +0000 (16:59 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 16 May 2011 15:09:06 +0000 (17:09 +0200)
Use the segment format instead of a hardcoded _TIME.

plugins/elements/gstinputselector.c

index 3e11605..9a3d6ec 100644 (file)
@@ -295,11 +295,11 @@ gst_selector_pad_get_running_time (GstSelectorPad * pad)
 
   GST_OBJECT_LOCK (pad);
   if (pad->active) {
-    gint64 position = pad->segment.position;
+    guint64 position = pad->segment.position;
+    GstFormat format = pad->segment.format;
 
     if (position >= 0)
-      ret = gst_segment_to_running_time (&pad->segment, GST_FORMAT_TIME,
-          position);
+      ret = gst_segment_to_running_time (&pad->segment, format, position);
   }
   GST_OBJECT_UNLOCK (pad);