[Mplayer-cvslog] CVS: main/libmpcodecs ad_pcm.c,1.2,1.3
Arpi of Ize
arpi at mplayer.dev.hu
Mon Apr 1 17:45:48 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv8890
Modified Files:
ad_pcm.c
Log Message:
cleanup
Index: ad_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_pcm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ad_pcm.c 1 Apr 2002 15:25:50 -0000 1.2
+++ ad_pcm.c 1 Apr 2002 15:45:45 -0000 1.3
@@ -29,8 +29,6 @@
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 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;j<len;j+=2){
char x=buf[j];
buf[j]=buf[j+1];
buf[j+1]=x;
}
- return len;
}
- return demux_read_data(sh_audio->ds,buf,minlen);
+ return len;
}
More information about the MPlayer-cvslog
mailing list