mpv/libmenu
Uoti Urpala 201bef7ee1 Implement vsync-aware frame timing for VDPAU
Main things added are custom frame dropping for VDPAU to work around
the display FPS limit, frame timing adjustment to avoid jitter when
video frame times keep falling near vsyncs, and use of VDPAU's timing
feature to keep one future frame queued in advance.

NVIDIA's VDPAU implementation refuses to change the displayed frame
more than once per vsync. This set a limit on how much video could be
sped up, and caused problems for nearly all videos on low-FPS video
projectors (playing 24 FPS video on a 24 FPS projector would not work
reliably as MPlayer may need to slightly speed up the video for AV
sync). This commit adds a framedrop mechanism that drops some frames
so that no more than one is sent for display per vsync. The code
tries to select the dropped frames smartly, selecting the best one to
show for each vsync. Because of the timing features needed the drop
functionality currently does not work if the correct-pts option is
disabled.

The code also adjusts frame timing slightly to avoid jitter. If you
for example play 24 FPS video content on a 72 FPS display then
normally a frame would be shown for 3 vsyncs, but if the frame times
happen to fall near vsyncs and change between just before and just
after then there could be frames alternating between 2 and 4
vsyncs. The code changes frame timing by up to one quarter vsync
interval to avoid this.

The above functionality depends on having reliable vsync timing
information available. The display refresh rate is not directly
provided by the VDPAU API. The current code uses information from the
XF86VidMode extension if available; I'm not sure how common cases
where that is inaccurate are. The refresh rate can be specified
manually if necessary.

After the changes in this commit MPlayer now always tries to keep one
frame queued for future display using VDPAU's internal timing
mechanism (however no more than 50 ms to the future). This should make
video playback somewhat more robust against timing inaccuracies caused
by system load.
2009-11-15 12:45:58 +02:00
..
menu.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu.h Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_chapsel.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_cmdlist.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_console.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_dvbin.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_filesel.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_list.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_list.h Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_param.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_pt.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
menu_txt.c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
vf_menu.c Implement vsync-aware frame timing for VDPAU 2009-11-15 12:45:58 +02:00