Fix XVideo on GeForce by using last available adaptor
authorSam Lantinga <slouken@libsdl.org>
Fri, 14 Sep 2001 02:55:36 +0000
changeset 182d4ebd1bbea9a
parent 181 e5bc29de3f0a
child 183 561c2d2f3505
Fix XVideo on GeForce by using last available adaptor
docs.html
src/video/x11/SDL_x11yuv.c
     1.1 --- a/docs.html	Fri Sep 14 02:41:09 2001 +0000
     1.2 +++ b/docs.html	Fri Sep 14 02:55:36 2001 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  Major changes since SDL 1.0.0:
     1.5  </H2>
     1.6  <UL>
     1.7 +	<LI> 1.2.3: Fix XVideo on GeForce by using last available adaptor
     1.8  	<LI> 1.2.3: Added CD-ROM support for BSD/OS (thanks Steven!)
     1.9  	<LI> 1.2.3: Added library version information to the Windows DLL
    1.10  	<LI> 1.2.3: Added initial support for EPOC/Symbian OS (thanks Hannu!)
     2.1 --- a/src/video/x11/SDL_x11yuv.c	Fri Sep 14 02:41:09 2001 +0000
     2.2 +++ b/src/video/x11/SDL_x11yuv.c	Fri Sep 14 02:55:36 2001 +0000
     2.3 @@ -50,6 +50,9 @@
     2.4  /* Workaround when pitch != width */
     2.5  #define PITCH_WORKAROUND
     2.6  
     2.7 +/* Fix for the NVidia GeForce 2 - use the last available adaptor */
     2.8 +#define USE_LAST_ADAPTOR
     2.9 +
    2.10  /* The functions used to manipulate software video overlays */
    2.11  static struct private_yuvhwfuncs x11_yuvfuncs = {
    2.12  	X11_LockYUVOverlay,
    2.13 @@ -81,7 +84,11 @@
    2.14  	     (Success == XvQueryAdaptors(GFX_Display,
    2.15  	                                 RootWindow(GFX_Display, SDL_Screen),
    2.16  	                                 &adaptors, &ainfo)) ) {
    2.17 +#ifdef USE_LAST_ADAPTOR
    2.18 +		for ( i=0; i < adaptors; ++i ) {
    2.19 +#else
    2.20  		for ( i=0; (i < adaptors) && (xv_port == -1); ++i ) {
    2.21 +#endif /* USE_LAST_ADAPTOR */
    2.22  			/* Check to see if the visual can be used */
    2.23  			if ( BUGGY_XFREE86(<=, 4001) ) {
    2.24  				int visual_ok = 0;
    2.25 @@ -102,7 +109,11 @@
    2.26  				XvImageFormatValues *formats;
    2.27  				formats = XvListImageFormats(GFX_Display,
    2.28  				              ainfo[i].base_id, &num_formats);
    2.29 +#ifdef USE_LAST_ADAPTOR
    2.30 +				for ( j=0; j < num_formats; ++j ) {
    2.31 +#else
    2.32  				for ( j=0; (j < num_formats) && (xv_port == -1); ++j ) {
    2.33 +#endif /* USE_LAST_ADAPTOR */
    2.34  					if ( (Uint32)formats[j].id == format ) {
    2.35  						for ( k=0; k < ainfo[i].num_ports; ++k ) {
    2.36  							if ( Success == XvGrabPort(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {