vo_vdpau: disable refresh-aware frame timing when composited
commit31458a51b5c6a7c8a6449b0b3baa4f3fef6c4938
authorUoti Urpala <uau@mplayer2.org>
Fri, 27 Jul 2012 00:40:38 +0000 (27 03:40 +0300)
committerUoti Urpala <uau@mplayer2.org>
Fri, 27 Jul 2012 00:40:38 +0000 (27 03:40 +0300)
treea7504628cd47ac9f4df4190a3a95f235c4e8178d
parentadfa7bdfb2c61b136b2d15dcae516c0394b2e86b
vo_vdpau: disable refresh-aware frame timing when composited

Under a compositing window manager the current VDPAU implementation
behaves differently than without it. Frame flip timing info becomes
incorrect (I guess it only reflects when the frame was sent to the
compositor, not when it was actually shown), and there is no
limitation to at most one frame switch per refresh like without
compositing. Detect whether a compositing window manager is active and
disable refresh-aware frame timing and dropping in this case,
similarly to what fps=-1 would do. This behavior can be controlled
with the new suboption "composite-detect".

Disabling the refresh-aware logic makes timing somewhat less accurate.
Because the video switch rate limit isn't there, the lack of frame
dropping on player side does not impose a hard limit on video FPS, but
does reduce performance somewhat as redundant frames are drawn in
memory.

The existence of a compositing window manager does not guarantee that
the current window is actually composited, so the current check is not
foolproof. In particular, some WMs have support for a "unredirect
fullscreen windows" option. Support for such things could be improved.
libvo/vo_vdpau.c
libvo/x11_common.c
libvo/x11_common.h