Skip to content

Commit

Permalink
Fix XVideo on GeForce by using last available adaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 14, 2001
1 parent 30dd107 commit 976e5a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs.html
Expand Up @@ -16,6 +16,7 @@ <H2>
Major changes since SDL 1.0.0:
</H2>
<UL>
<LI> 1.2.3: Fix XVideo on GeForce by using last available adaptor
<LI> 1.2.3: Added CD-ROM support for BSD/OS (thanks Steven!)
<LI> 1.2.3: Added library version information to the Windows DLL
<LI> 1.2.3: Added initial support for EPOC/Symbian OS (thanks Hannu!)
Expand Down
11 changes: 11 additions & 0 deletions src/video/x11/SDL_x11yuv.c
Expand Up @@ -50,6 +50,9 @@ static char rcsid =
/* Workaround when pitch != width */
#define PITCH_WORKAROUND

/* Fix for the NVidia GeForce 2 - use the last available adaptor */
#define USE_LAST_ADAPTOR

/* The functions used to manipulate software video overlays */
static struct private_yuvhwfuncs x11_yuvfuncs = {
X11_LockYUVOverlay,
Expand Down Expand Up @@ -81,7 +84,11 @@ SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, S
(Success == XvQueryAdaptors(GFX_Display,
RootWindow(GFX_Display, SDL_Screen),
&adaptors, &ainfo)) ) {
#ifdef USE_LAST_ADAPTOR
for ( i=0; i < adaptors; ++i ) {
#else
for ( i=0; (i < adaptors) && (xv_port == -1); ++i ) {
#endif /* USE_LAST_ADAPTOR */
/* Check to see if the visual can be used */
if ( BUGGY_XFREE86(<=, 4001) ) {
int visual_ok = 0;
Expand All @@ -102,7 +109,11 @@ SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, S
XvImageFormatValues *formats;
formats = XvListImageFormats(GFX_Display,
ainfo[i].base_id, &num_formats);
#ifdef USE_LAST_ADAPTOR
for ( j=0; j < num_formats; ++j ) {
#else
for ( j=0; (j < num_formats) && (xv_port == -1); ++j ) {
#endif /* USE_LAST_ADAPTOR */
if ( (Uint32)formats[j].id == format ) {
for ( k=0; k < ainfo[i].num_ports; ++k ) {
if ( Success == XvGrabPort(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {
Expand Down

0 comments on commit 976e5a2

Please sign in to comment.