videodecoder: Restrict frame timestamp guessing in reverse mode
authorJan Schmidt <jan@centricular.com>
Fri, 3 Mar 2017 13:18:07 +0000 (00:18 +1100)
committerJan Schmidt <jan@centricular.com>
Fri, 3 Mar 2017 13:30:37 +0000 (00:30 +1100)
Don't guess a timestamp of the start of the segment when running
in reverse mode, as more likely it means we're discontinuous somewhere
in the middle of the segment, and we'll fix up timestamps once
the frames are decoded and reversed.

gst-libs/gst/video/gstvideodecoder.c

index 19898f5b318aa1cec75ae2b0eae9a290566ce9a1..8e2a6236153e74b939a5c95003d16272f2b60695 100644 (file)
@@ -2773,7 +2773,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
     if (frame->duration != GST_CLOCK_TIME_NONE) {
       if (GST_CLOCK_TIME_IS_VALID (priv->last_timestamp_out))
         frame->pts = priv->last_timestamp_out + frame->duration;
-      else
+      else if (decoder->output_segment.rate > 0.0)
         frame->pts = decoder->output_segment.start;
       GST_LOG_OBJECT (decoder,
           "Guessing timestamp %" GST_TIME_FORMAT " for frame...",