[Mplayer-cvslog] CVS: main/libmpcodecs ad_pcm.c,1.3,1.4
Arpi of Ize
arpi at mplayerhq.hu
Thu Apr 25 14:29:58 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv939
Modified Files:
ad_pcm.c
Log Message:
bigendian fix - thx to Rogério Brito <linuxconsult at yahoo.com.br>
Index: ad_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_pcm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ad_pcm.c 1 Apr 2002 15:45:45 -0000 1.3
+++ ad_pcm.c 25 Apr 2002 12:29:55 -0000 1.4
@@ -30,7 +30,7 @@
case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break;
case 0x50: sh_audio->sample_format=AFMT_MPEG;break;
/* case 0x2000: sh_audio->sample_format=AFMT_AC3; */
- default: sh_audio->sample_format=(sh_audio->samplesize==2)?AFMT_S16_LE:AFMT_U8;
+ default: if(sh_audio->samplesize!=2) sh_audio->sample_format=AFMT_U8;
}
return 1;
}
@@ -64,7 +64,11 @@
int len=sh_audio->channels*sh_audio->samplesize-1;
len=(minlen+len)&(~len); // sample align
len=demux_read_data(sh_audio->ds,buf,len);
+#ifdef WORDS_BIGENDIAN
+ if(sh_audio->format!=0x736F7774){
+#else
if(sh_audio->format==0x736F7774){ // "twos" is swapped byteorder
+#endif
int j;
for(j=0;j<len;j+=2){
char x=buf[j];
More information about the MPlayer-cvslog
mailing list