libs/gst/base/gstbasesink.c: Can't use gst_segment_to_running_time() when the segment...
authorTim-Philipp Müller <tim@centricular.net>
Tue, 14 Mar 2006 18:25:54 +0000 (18:25 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 14 Mar 2006 18:25:54 +0000 (18:25 +0000)
Original commit message from CVS:
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times):
Can't use gst_segment_to_running_time() when the segment
is not in GST_TIME_FORMAT (like with filesink, for example).
Stops flac encoding pipelines from spewing critical warnings
at EOS (#331248).

ChangeLog
libs/gst/base/gstbasesink.c

index a254f54..7afca8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2006-03-14  Tim-Philipp Müller  <tim at centricular dot net>
 
+       * libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times):
+         Can't use gst_segment_to_running_time() when the segment
+         is not in GST_TIME_FORMAT (like with filesink, for example).
+         Stops flac encoding pipelines from spewing critical warnings
+         at EOS (#331248).
+         
+2006-03-14  Tim-Philipp Müller  <tim at centricular dot net>
+
        * gst/gstpipeline.c: (gst_pipeline_class_init):
          Add 'Since: 0.10.5' to gtk-doc blurb for added property.
 
index ae6d2bc..9127dbd 100644 (file)
@@ -767,11 +767,17 @@ gst_base_sink_get_sync_times (GstBaseSink * basesink, GstMiniObject * obj,
     }
   }
 
-  *start =
-      gst_segment_to_running_time (&basesink->segment, GST_FORMAT_TIME, cstart);
-  *stop =
-      gst_segment_to_running_time (&basesink->segment, GST_FORMAT_TIME, cstop);
-
+  if (G_LIKELY (basesink->segment.format == GST_FORMAT_TIME)) {
+    *start =
+        gst_segment_to_running_time (&basesink->segment, GST_FORMAT_TIME,
+        cstart);
+    *stop =
+        gst_segment_to_running_time (&basesink->segment, GST_FORMAT_TIME,
+        cstop);
+  } else {
+    *start = -1;
+    *stop = -1;
+  }
   /* buffers always need syncing and preroll */
   return TRUE;