[MPlayer-dev-eng] mencoder not endian clean on ppc

Max Berger max.berger at xslt.de
Mon Jul 29 00:24:53 CEST 2002


High,

again, another portability issue :).
Same Version, mplayer cvs checkout from Jul 28

built on Mac OS X 10.1.5, PowerPC

encoded a small test file to avi... heres what the header it is supposed 
to be:

---snip---
00000000  52 49 46 46 16 ef 09 00  41 56 49 20 4c 49 53 54  |RIFF....AVI 
LIST|
00000010  32 01 00 00 68 64 72 6c  61 76 69 68 38 00 00 00  
|2...hdrlavih8...|
00000020  40 9c 00 00 00 00 00 00  00 00 00 00 10 09 00 00  
|@...............|
00000030  6c 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  
|l...............|
00000040  d0 02 00 00 40 02 00 00  00 00 00 00 00 00 00 00  
|.... at ...........|
00000050  00 00 00 00 00 00 00 00  4c 49 53 54 74 00 00 00  
|........LISTt...|
00000060  73 74 72 6c 73 74 72 68  38 00 00 00 76 69 64 73  
|strlstrh8...vids|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
00000080  10 27 00 00 90 d0 03 00  00 00 00 00 6c 00 00 00  
|.'..........l...|
00000090  ca 97 00 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
000000a0  00 00 00 00 73 74 72 66  28 00 00 00 28 00 00 00  
|....strf(...(...|
000000b0  d0 02 00 00 40 02 00 00  01 00 18 00 44 49 56 58  
|.... at .......DIVX|
000000c0  00 fc 12 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
000000d0  00 00 00 00 4c 49 53 54  6a 00 00 00 73 74 72 6c  
|....LISTj...strl|
000000e0  73 74 72 68 38 00 00 00  61 75 64 73 00 00 00 00  
|strh8...auds....|
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 80 04 00 
00  |................|
00000100  80 bb 00 00 00 00 00 00  c8 00 00 00 00 03 00 
00  |................|
00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
00000120  73 74 72 66 1e 00 00 00  55 00 02 00 80 bb 00 00  
|strf....U.......|
00000130  48 58 00 00 80 04 00 00  0c 00 01 00 02 00 00 00  
|HX..............|
---snip---

and heres what I get:

---snip---
00000000  46 46 49 52 00 09 fe 62  20 49 56 41 54 53 49 4c  |FFIR...b 
IVATSIL|
00000010  00 00 01 32 6c 72 64 68  68 69 76 61 00 00 00 38  
|...2lrdhhiva...8|
00000020  00 00 9c 40 00 00 00 00  00 00 00 00 00 00 09 10  
|... at ............|
00000030  00 00 00 6c 00 00 00 00  00 00 00 02 00 00 00 00  
|...l............|
00000040  00 00 02 d0 00 00 02 40  00 00 00 00 00 00 00 00  
|....... at ........|
00000050  00 00 00 00 00 00 00 00  54 53 49 4c 00 00 00 74  
|........TSIL...t|
00000060  6c 72 74 73 68 72 74 73  00 00 00 38 73 64 69 76  
|lrtshrts...8sdiv|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
00000080  00 00 27 10 00 03 d0 90  00 00 00 00 00 00 00 6c  
|..'............l|
00000090  00 00 a0 b4 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
000000a0  00 00 00 00 66 72 74 73  00 00 00 28 00 00 00 28  
|....frts...(...(|
000000b0  00 00 02 d0 00 00 02 40  00 01 00 18 58 56 49 44  
|....... at ....XVID|
000000c0  00 12 fc 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
000000d0  00 00 00 00 54 53 49 4c  00 00 00 6a 6c 72 74 73  
|....TSIL...jlrts|
000000e0  68 72 74 73 00 00 00 38  73 64 75 61 00 00 00 00  
|hrts...8sdua....|
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 04 
80  |................|
00000100  00 00 bb 80 00 00 00 00  00 00 00 c8 00 00 03 
00  |................|
00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 
00  |................|
00000120  66 72 74 73 00 00 00 1e  00 55 00 02 00 00 bb 80  
|frts.....U......|
00000130  00 00 58 34 04 80 00 00  00 0c 00 01 00 00 00 02  
|..X4............|
---snip---

As you can see, all quadruplets are backwards: FIRR<->RIFF, "AVI "<->" 
IVA", ...

this looks like a simple endian issue (ppc has big endian). Should be 
easy to fix for someone who knows what he's doing. I don't but I could 
find out and try to submit a patch if necessary.

Questions? Comments?

mfG

Max Berger
ICQ: 44986764
e-mail: max.berger at xslt.de

--
PGP/GnuPG ID: E81592BC   Print: F489F8759D4132923EC4 BC7E072AB73AE81592BC
SysAdmin: http://www7.in.tum.de/ SyncML: http://libsyncml.sourceforge.net
XSLT: http://www.xslt.de    Mail written on MacOS X: http://www.apple.com




More information about the MPlayer-dev-eng mailing list