diff options
author | wm4 <wm4@nowhere> | 2015-11-11 19:52:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-11 19:52:35 +0100 |
commit | 7c4fe02d01322ad09954d63522c0c8bf3f06b3d1 (patch) | |
tree | 4578fe49ce5703a1f6431e2057dbaf3e02da0cde /player | |
parent | b7398cbdd89f083db564b03bc1dc25bdf6544ed6 (diff) |
player: less naive rounding
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index d09cf3800a..0aebc6a7e9 100644 --- a/player/video.c +++ b/player/video.c @@ -1004,7 +1004,7 @@ static void handle_display_sync_frame(struct MPContext *mpctx, // We use the speed-adjusted (i.e. real) frame duration for this. double frame_duration = adjusted_duration / mpctx->speed_factor_v; double ratio = (frame_duration + mpctx->display_sync_error) / vsync; - int num_vsyncs = MPMAX(floor(ratio + 0.5), 0); + int num_vsyncs = MPMAX(lrint(ratio), 0); double prev_error = mpctx->display_sync_error; mpctx->display_sync_error += frame_duration - num_vsyncs * vsync; frame->vsync_offset = mpctx->display_sync_error * 1e6; |