1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 14:26:57 +00:00
mpv/player
nanahi eaae9e9cf5 player/video: fix incorrect VO frame duration and frame drops
The logic in question was added in 201bef7ee1
for the VDPAU vsync frame timing algorithm, but after the code was moved
around for several times, it is now used for all VOs with non-display-sync
mode (where the video is synced to audio or system time). It nonetheless
likely never did whatever it was intended for.

This "correction" reduced the VO frame duration by the amount that the
frame is fallen behind the ideal time. Since a frame is presented between
pts (the ideal time for which the frame is scheduled) and pts + duration
(the end time for which frame drop is determined), and pts is already
computed from the current time and the deviation from the ideal time, this
"correction" causes the end time to have the deviation added twice, which
is nonsense: if the deviation is -0.5x the frame duration, the frame is
dropped, even though it should be displayed from now to 0.5x the frame
duration from now.

It was not noticed at that time probably because the VDPAU secret rabbit
code undid some of its damage, and the subsequent development focus on
display-sync modes resulted in negligence and simplification of audio mode
(e.g. b8bcf0f466), but the generic VO frame
drop algorithm has been observed to cause inconsistent frame drops with
this "correction": playing a 59.94 Hz video at 2x speed on a 60 Hz display
results in spending over half of the time dropping adjacent frames instead
of every other frames, visually causing stuttering, while it should only
happen briefly when the pts is very close to vsync time.

Fix this by deleting this logic, making the VO frame always having the
duration of the video frame.

Fixes: 201bef7ee1
2024-05-29 13:39:32 +00:00
..
javascript console.lua: don't convert integers for mp.input to string 2024-05-12 23:13:48 +02:00
lua console.lua: fix crash with set ;<Tab> 2024-05-28 13:25:37 +00:00
audio.c audio: report EOF also for untimed AO mode 2024-05-10 23:56:56 +02:00
client.c player/client: fix typo in description of MPV_ERROR_UNINITIALIZED 2024-05-08 18:52:40 +02:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c Revert "player: do not exit when a seek gets queued" 2024-05-16 13:26:34 +00:00
command.h options: add --input-commands option 2024-03-21 14:48:53 +00:00
configfiles.c player/configfiles: fix utime.h include for Windows SDK 2024-05-06 22:01:17 +02:00
core.h select.lua: add this script 2024-05-12 23:13:48 +02:00
external_files.c misc/language: move mp_guess_lang_from_filename() here 2024-05-10 01:22:31 +02:00
external_files.h misc/language: move mp_guess_lang_from_filename() here 2024-05-10 01:22:31 +02:00
javascript.c osdep/dirent: add implementation for Windows SDK build 2024-05-06 22:01:17 +02:00
loadfile.c player/loadfile: match language and subcodes 2024-05-09 17:12:55 +02:00
lua.c select.lua: add this script 2024-05-12 23:13:48 +02:00
main.c various: fix indentation 2024-05-07 11:23:08 +02:00
meson.build meson: generate .com in the same place as the .exe if possible 2023-11-27 18:42:19 +00:00
misc.c various: add missing checks for directory streams 2024-05-15 22:45:18 +02:00
osd.c demux: keep track of ts information per stream type 2024-05-05 14:11:47 +02:00
playloop.c playloop: don't loop when seeking to the end of cover art while paused 2024-05-26 14:23:57 +00:00
screenshot.c image_writer: fix TOCTOU in screenshot filename generation 2024-03-19 19:30:27 +01:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c select.lua: add this script 2024-05-12 23:13:48 +02:00
sub.c player: avoid busy looping during reinit_sub 2024-04-16 19:45:00 +00:00
video.c player/video: fix incorrect VO frame duration and frame drops 2024-05-29 13:39:32 +00:00