From a8b78d514924326cfff1cca164300a20144592c3 Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 25 Apr 2002 12:29:55 +0000 Subject: =?UTF-8?q?bigendian=20fix=20-=20thx=20to=20Rog=C3=A9rio=20Brito?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5828 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_pcm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libmpcodecs/ad_pcm.c') diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index a2efd63b10..13d77666e7 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -30,7 +30,7 @@ static int init(sh_audio_t *sh_audio) 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 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m 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