videosink: Don't return unknown end-time from get_times()
authorSeungha Yang <seungha@centricular.com>
Wed, 5 Oct 2022 15:00:59 +0000 (00:00 +0900)
committerSebastian Dröge <slomo@coaxion.net>
Thu, 6 Oct 2022 06:36:42 +0000 (06:36 +0000)
... in case of reverse playback. Otherwise basesink will not
wait for clock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3121>

subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c

index 67d634a..8450a42 100644 (file)
@@ -273,6 +273,12 @@ gst_video_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
       *end = timestamp +
           gst_util_uint64_scale_int (GST_SECOND, vsink->priv->info.fps_d,
           vsink->priv->info.fps_n);
+    } else if (bsink->segment.rate < 0) {
+      /* The end time will be used for clock waiting time position
+       * in case of revese playback, and unknown end time will result in
+       * never waiting for clock (as if sync=false).
+       * Returning timestamp here would be the best effort we can do */
+      *end = timestamp;
     }
   }
 }