diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-27 10:05:39 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-27 10:05:39 +0000 |
commit | 85626ef1aada82f4628101534200927ba54ed6c7 (patch) | |
tree | abeceffddb91e04077a81d7c6fdfcc0cfd6745f7 /libvo/x11_common.c | |
parent | 189e0d00a625fc3dc03adcbb196a1604074a329f (diff) | |
download | mpv-85626ef1aada82f4628101534200927ba54ed6c7.tar.bz2 mpv-85626ef1aada82f4628101534200927ba54ed6c7.tar.xz |
Try to set XV_SYNC_TO_VBLANK to enable vsync on non-overlay xv adapters.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15827 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r-- | libvo/x11_common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 50034c2e1e..d40ead6b2a 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -2284,6 +2284,19 @@ static Atom xv_intern_atom_if_exists( char const * atom_name ) return xv_atom; } + +/** + * \brief Try to enable vsync for xv. + * \return Returns -1 if not available, 0 on failure and 1 on success. + */ +int vo_xv_enable_vsync() +{ + Atom xv_atom = xv_intern_atom_if_exists("XV_SYNC_TO_VBLANK"); + if (xv_atom == None) + return -1; + return XvSetPortAttribute(mDisplay, xv_port, xv_atom, 1) == Success; +} + /** * \brief Print information about the colorkey method and source. * |