[Mplayer-cvslog] CVS: main/libmpcodecs ad_pcm.c,1.1,1.2
Arpi of Ize
arpi at mplayer.dev.hu
Mon Apr 1 17:25:53 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv1433
Modified Files:
ad_pcm.c
Log Message:
twos audio fixed
Index: ad_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_pcm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ad_pcm.c 25 Mar 2002 21:06:01 -0000 1.1
+++ ad_pcm.c 1 Apr 2002 15:25:50 -0000 1.2
@@ -29,7 +29,8 @@
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;
- case 0x736F7774: sh_audio->sample_format=AFMT_S16_LE;sh_audio->codec->driver=AFM_DVDPCM;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;
}
@@ -62,5 +63,15 @@
static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
{
+ if(sh_audio->format==0x736F7774){ // "twos" is swapped byteorder
+ int j,len;
+ len=demux_read_data(sh_audio->ds,buf,(minlen+1)&(~1));
+ 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);
}
More information about the MPlayer-cvslog
mailing list