basesrc: do not set first buffer timestamp to 0 for live sources
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 4 May 2011 12:31:56 +0000 (15:31 +0300)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 12 May 2011 17:10:14 +0000 (18:10 +0100)
Doing so avoids a large timestamp gap between first and second buffer
for live sources which take time to start up.
The first buffer now has a "live" timestamp based on the running time,
as other buffers do.

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

libs/gst/base/gstbasesrc.c

index 2b59d48..59319e2 100644 (file)
@@ -2160,7 +2160,7 @@ again:
 
   /* no timestamp set and we are at offset 0, we can timestamp with 0 */
   if (offset == 0 && src->segment.time == 0
-      && GST_BUFFER_TIMESTAMP (*buf) == -1) {
+      && GST_BUFFER_TIMESTAMP (*buf) == -1 && !src->is_live) {
     *buf = gst_buffer_make_metadata_writable (*buf);
     GST_BUFFER_TIMESTAMP (*buf) = 0;
   }