From 1bd4364bc489d9d26b3b9dc96b8c995bb49d6041 Mon Sep 17 00:00:00 2001 From: arpi Date: Mon, 1 Apr 2002 15:45:45 +0000 Subject: [PATCH] cleanup git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5456 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_pcm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index e45ed70088..a2efd63b10 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -29,8 +29,6 @@ static int init(sh_audio_t *sh_audio) case 0x7: sh_audio->sample_format=AFMT_MU_LAW;break; case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break; case 0x50: sh_audio->sample_format=AFMT_MPEG;break; - // format 0x736f7774 ; "twos" (MOV files) - case 0x736F7774: sh_audio->sample_format=AFMT_S16_LE;/*sh_audio->codec->driver=AFM_DVDPCM;*/ break; /* case 0x2000: sh_audio->sample_format=AFMT_AC3; */ default: sh_audio->sample_format=(sh_audio->samplesize==2)?AFMT_S16_LE:AFMT_U8; } @@ -63,15 +61,16 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...) static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen) { + int len=sh_audio->channels*sh_audio->samplesize-1; + len=(minlen+len)&(~len); // sample align + len=demux_read_data(sh_audio->ds,buf,len); if(sh_audio->format==0x736F7774){ // "twos" is swapped byteorder - int j,len; - len=demux_read_data(sh_audio->ds,buf,(minlen+1)&(~1)); + int j; for(j=0;jds,buf,minlen); + return len; }