ffdec: be more careful with DTS timestamp interpolation
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 22 Oct 2010 10:59:02 +0000 (12:59 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 22 Oct 2010 11:05:16 +0000 (13:05 +0200)
Don't use -1 and 0 duration buffers to calculate next output timestamp as they
are very likely wrong.

Fixes #632877

ext/ffmpeg/gstffmpegdec.c

index db1364c..b959598 100644 (file)
@@ -1903,8 +1903,10 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
   }
   GST_BUFFER_DURATION (*outbuf) = out_duration;
 
-  if (out_timestamp != -1 && out_duration != -1)
+  if (out_timestamp != -1 && out_duration != -1 && out_duration != 0)
     ffmpegdec->next_out = out_timestamp + out_duration;
+  else
+    ffmpegdec->next_out = -1;
 
   /* palette is not part of raw video frame in gst and the size
    * of the outgoing buffer needs to be adjusted accordingly */