[MPlayer-users] MPlayer 0.50 on sparc solaris 8
Gregory A. Shimansky
gregory at lab.sun.mcst.ru
Tue Oct 9 12:34:11 CEST 2001
Hi
I've just installed Mplayer on my sparc solaris station (it seems to be the
only program that allows me to view DivX on solaris, but not out of the
box). I've fixed some problems so here's my bug report.
First thing: on SPARC (and I think on other RISC processors all memory
pointers should be aligned to the size of data types which they pointer
to). I had to patch file opendivx/basic_prediction.c to make it work on
sparc. Here's the patch:
131,135c131,157
< for (dy = 0; dy < 8; dy++) {
< lpDst[0] = lpSrc[0];
< lpDst[1] = lpSrc[1];
< lpSrc += lpStride;
< lpDst += lpStride;
---
> #ifdef __sparc
> /* On SPARC all pointers should be aligned to the size of their
> data type!! Can't copy longs unless all pointers are 4-bytes
> aligned */
> if( ( ( ( unsigned long )Src ) & 3 ) ||
> ( ( ( unsigned long )Dst ) & 3 ) ||
> ( Stride & 3 ) )
> for( dy = 0; dy < 8; dy++ )
> {
> Dst[ 0 ] = Src[ 0 ];
> Dst[ 1 ] = Src[ 1 ];
> Dst[ 2 ] = Src[ 2 ];
> Dst[ 3 ] = Src[ 3 ];
> Dst[ 4 ] = Src[ 4 ];
> Dst[ 5 ] = Src[ 5 ];
> Dst[ 6 ] = Src[ 6 ];
> Dst[ 7 ] = Src[ 7 ];
> Src += Stride;
> Dst += Stride;
> }
> else
> #endif
> for (dy = 0; dy < 8; dy++) {
> lpDst[0] = lpSrc[0];
> lpDst[1] = lpSrc[1];
> lpSrc += lpStride;
> lpDst += lpStride;
227,234c249,287
< for (dy = 0; dy < 16; dy++) {
< lpDst[0] = lpSrc[0];
< lpDst[1] = lpSrc[1];
< lpDst[2] = lpSrc[2];
< lpDst[3] = lpSrc[3];
< lpSrc += lpStride;
< lpDst += lpStride;
< }
---
> #ifdef __sparc
> /* On SPARC all pointers should be aligned to the size of their
> data type!! Can't copy longs unless all pointers are 4-bytes
> aligned */
> if( ( ( ( unsigned long )Src ) & 3 ) ||
> ( ( ( unsigned long )Dst ) & 3 ) ||
> ( Stride & 3 ) )
> for( dy = 0; dy < 16; dy++ )
> {
> Dst[ 0 ] = Src[ 0 ];
> Dst[ 1 ] = Src[ 1 ];
> Dst[ 2 ] = Src[ 2 ];
> Dst[ 3 ] = Src[ 3 ];
> Dst[ 4 ] = Src[ 4 ];
> Dst[ 5 ] = Src[ 5 ];
> Dst[ 6 ] = Src[ 6 ];
> Dst[ 7 ] = Src[ 7 ];
> Dst[ 8 ] = Src[ 8 ];
> Dst[ 9 ] = Src[ 9 ];
> Dst[10 ] = Src[10 ];
> Dst[11 ] = Src[11 ];
> Dst[12 ] = Src[12 ];
> Dst[13 ] = Src[13 ];
> Dst[14 ] = Src[14 ];
> Dst[15 ] = Src[15 ];
> Src += Stride;
> Dst += Stride;
> }
> else
> #endif
> for( dy = 0; dy < 16; dy++ )
> {
> lpDst[0] = lpSrc[0];
> lpDst[1] = lpSrc[1];
> lpDst[2] = lpSrc[2];
> lpDst[3] = lpSrc[3];
> lpSrc += lpStride;
> lpDst += lpStride;
> }
There are also bus errors in mplayer.c and demux_avi.c when printing
floating point values. I didn't look into it, but changing mp_msg to printf
helps. Perhaps it has something to do with sparc automatically converting
floats to doubles when passing to a function with variable argument list.
I'll write here if I figure what's wrong there.
Hope it helps.
--
Gregory
More information about the MPlayer-users
mailing list