videoaggregator: Use floor() to calculate current position
authorSeungha Yang <seungha@centricular.com>
Fri, 18 Feb 2022 16:58:20 +0000 (01:58 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 19 Feb 2022 06:53:02 +0000 (06:53 +0000)
... instead of round(). Depending on framerate, calculated position
may not be clearly represented by using uint64, 30000/1001 for example.
Then the result of round() can be sliglhtly larger (1ns) than
buffer timestamp. And that will cause unnecessary frame delay.

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

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

index 19ec53b..75bd663 100644 (file)
@@ -2263,7 +2263,7 @@ gst_video_aggregator_aggregate (GstAggregator * agg, gboolean timeout)
   if (GST_VIDEO_INFO_FPS_N (&vagg->info) == 0) {
     output_end_time = -1;
   } else {
-    guint64 dur = gst_util_uint64_scale_round (vagg->priv->nframes + 1,
+    guint64 dur = gst_util_uint64_scale (vagg->priv->nframes + 1,
         GST_SECOND * GST_VIDEO_INFO_FPS_D (&vagg->info),
         GST_VIDEO_INFO_FPS_N (&vagg->info));