CVS: main/libmpcodecs ad_liba52.c,1.10,1.11
Update of /cvsroot/mplayer/main/libmpcodecs In directory mail:/var/tmp.root/cvs-serv8888 Modified Files: ad_liba52.c Log Message: fix for bigendian systems Index: ad_liba52.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_liba52.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ad_liba52.c 17 May 2003 11:35:32 -0000 1.10 +++ ad_liba52.c 26 Sep 2003 19:36:19 -0000 1.11 @@ -48,7 +48,9 @@ if(c<0) return -1; /* EOF*/ sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c; } +#ifndef WORDS_BIGENDIAN if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); +#endif length = a52_syncinfo (sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); if(length>=7 && length<=3840) break; /* we're done.*/ /* bad file => resync*/
Hi,
Modified Files: ad_liba52.c Log Message: fix for bigendian systems
fix what? i didnt heard that ac3 was broken on bigendian...
Index: ad_liba52.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_liba52.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ad_liba52.c 17 May 2003 11:35:32 -0000 1.10 +++ ad_liba52.c 26 Sep 2003 19:36:19 -0000 1.11 @@ -48,7 +48,9 @@ if(c<0) return -1; /* EOF*/ sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c; } +#ifndef WORDS_BIGENDIAN if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer, sh_audio->a_in_buffer,8); +#endif length = a52_syncinfo (sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); if(length>=7 && length<=3840) break; /* we're done.*/ /* bad file => resync*/
also this fix is broken, so broken. if it isnt a vlid header, and it has to read one more byte, the header stuff will be swapped again, messing it all up. insteda of swapping the header in the buffer, liba52 should be fixed, to handle header parsing correctly on bigendian systems. but again: imho it worked well, no fix needed. A'rpi / Astral & ESP-team -- Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu
Hi,
if it isnt a vlid header, and it has to read one more byte, the header stuff will be swapped again, messing it all up. Just reread the code, and it is braindamaged imho, swipswapping all the times the 64bit sync tag, but only for original AC3 and not for Real's DNET. Also later in a52_printinfo it calls a52_syncinfo without byteswapping...
insteda of swapping the header in the buffer, liba52 should be fixed, to handle header parsing correctly on bigendian systems. but again: imho it worked well, no fix needed.
-- Alex Beregszaszi <alex@fsn.hu> (MPlayer Core Developer -- http://www.mplayerhq.hu/)
Hi,
if it isnt a vlid header, and it has to read one more byte, the header stuff will be swapped again, messing it all up. Just reread the code, and it is braindamaged imho, swipswapping all the times the 64bit sync tag, but only for original AC3 and not for Real's DNET. Also later in a52_printinfo it calls a52_syncinfo without byteswapping... Ah, forget the above!
Someone f*cked up the whole dnet handling, leaving the buffer unchanged in the demuxers and passing it away with the fourcc DNET, so all the decoders should care about it, in case of liba52, it byteswapps only the first 8 bytes (the syncinfo tag). Imho dnet is broken on BE systems now, but who knows if it works on LE? -- Alex Beregszaszi <alex@fsn.hu> (MPlayer Core Developer -- http://www.mplayerhq.hu/)
participants (3)
-
Alex Beregszaszi -
Alex Beregszaszi -
Arpi