[MPlayer-dev-eng] [PATCH] mp3 mangling FIXED!

Bob McElrath mcelrath at draal.physics.wisc.edu
Sun Sep 23 00:34:57 CEST 2001


Turns out the mp3 mangling on alpha was due to that dastardly
    sizeof(long) != sizeof(int) 
confusion on 64-bit archs.  I'm not even entirely sure why the following
patch works, but it does...

And now I can play mpegs!!!  WOOHOO!!!

Index: decod386.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp3lib/decod386.c,v
retrieving revision 1.7
diff -c -r1.7 decod386.c
*** decod386.c  14 Jul 2001 16:52:09 -0000      1.7
--- decod386.c  22 Sep 2001 22:31:41 -0000
***************
*** 56,62 ****
  
     /* sizeof(int) == 4 */
  #define WRITE_SAMPLE(samples,sum,clip) { \
!   double dtemp; long v;                  \
    dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
    v = (((int *)&dtemp)[MANTISSA_OFFSET] - 0x80000000); \
    if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
--- 56,62 ----
  
     /* sizeof(int) == 4 */
  #define WRITE_SAMPLE(samples,sum,clip) { \
!   double dtemp; int v;                  \
    dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
    v = (((int *)&dtemp)[MANTISSA_OFFSET] - 0x80000000); \
    if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \

Cheers,
-- Bob

Bob McElrath (rsmcelrath at students.wisc.edu) 
Univ. of Wisconsin at Madison, Department of Physics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20010922/f62599a4/attachment-0001.pgp>


More information about the MPlayer-dev-eng mailing list