# HG changeset patch # User reimar # Date 1119866739 0 # Node ID db966bdf6f5bf75c8218550963d82687be3e67f6 # Parent 8549fc0fb5b1b53cc1a68e18ceecea40c27a1628 Try to set XV_SYNC_TO_VBLANK to enable vsync on non-overlay xv adapters. diff -r 8549fc0fb5b1 -r db966bdf6f5b libvo/vo_xv.c --- a/libvo/vo_xv.c Mon Jun 27 08:16:23 2005 +0000 +++ b/libvo/vo_xv.c Mon Jun 27 10:05:39 2005 +0000 @@ -917,6 +917,7 @@ { return -1; // bail out, colorkey setup failed } + vo_xv_enable_vsync(); fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats); diff -r 8549fc0fb5b1 -r db966bdf6f5b libvo/x11_common.c --- 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. *