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
This commit is contained in:
reimar 2005-06-27 10:05:39 +00:00
parent 189e0d00a6
commit 85626ef1aa
2 changed files with 14 additions and 0 deletions

View File

@ -917,6 +917,7 @@ static uint32_t preinit(const char *arg)
{ {
return -1; // bail out, colorkey setup failed return -1; // bail out, colorkey setup failed
} }
vo_xv_enable_vsync();
fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats); fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats);

View File

@ -2284,6 +2284,19 @@ static Atom xv_intern_atom_if_exists( char const * atom_name )
return xv_atom; 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. * \brief Print information about the colorkey method and source.
* *