Mercurial > mplayer.hg
diff libvo/x11_common.c @ 15826:db966bdf6f5b
Try to set XV_SYNC_TO_VBLANK to enable vsync on non-overlay xv adapters.
author | reimar |
---|---|
date | Mon, 27 Jun 2005 10:05:39 +0000 |
parents | 32d9c8a0a02b |
children | 7f34acc96aa4 |
line wrap: on
line diff
--- a/libvo/x11_common.c Mon Jun 27 08:16:23 2005 +0000 +++ b/libvo/x11_common.c Mon Jun 27 10:05:39 2005 +0000 @@ -2284,6 +2284,19 @@ 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. *