[MPlayer-dev-eng] mplayer 1.0rc9 on NetBSD/sparc64 x11 reverts RGB/BGR

Pierre Pronchery khorben at defora.org
Thu Oct 4 00:51:31 CEST 2007


		Hi mplayer,

a while ago I discussed an issue with someone from NetBSD about a bug
from mplayer on sparc64, at least with XFree86 from xsrc. When using the
vo_x11 video output plug-in, the colors are wrong: the red and blue
channels are inverted.

I found a place in the code to force the YUV conversion routine choice
to BGR instead of RGB, but I'm not sure how exactly a "clean" patch
would look.

Basically, for MPlayer 1.0rc9nb9 from pkgsrc, in libvo/vo_x11.c line 481
if one changes:
481             out_format = IMGFMT_BGR32;
to
481             out_format = IMGFMT_RGB32;
then the output is correct.

but I also think that altering the check between the lines 515 to 524
would be a better solution. Removing the check there:
515 #ifdef WORDS_BIGENDIAN
516     if (myximage->byte_order != MSBFirst)
517 #else
518     if (myximage->byte_order != LSBFirst)
519 #endif
520     {
521 //        mode = ((myximage->blue_mask & 0x01) != 0) ? MODE_BGR :
MODE_RGB;
522 //   printf( "No support for non-native XImage byte order!\n" );
523 //   return -1;
524     }
also does the trick (if I did not mess up somewhere else).

In both cases though, I am afraid this will simply shift the problem to
little-endian platforms. Any ideas?

Cheers,
-- 
khorben




More information about the MPlayer-dev-eng mailing list