videoaggregator: Use floor() to calculate current position

... 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>
This commit is contained in:
Seungha Yang 2022-02-19 01:58:20 +09:00 committed by GStreamer Marge Bot
parent cf3d64129b
commit a0dc29841c

View 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));