comparison libmpcodecs/ad_alaw.c @ 7753:f569630d892f

set up ss_div/ss_mul properly, accept 'alaw' fourcc too
author arpi
date Wed, 16 Oct 2002 16:49:58 +0000
parents 28677d779205
children 9d0b052c4f74
comparison
equal deleted inserted replaced
7752:18f8233094da 7753:f569630d892f
29 } 29 }
30 30
31 static int preinit(sh_audio_t *sh) 31 static int preinit(sh_audio_t *sh)
32 { 32 {
33 sh->audio_out_minsize=2048; 33 sh->audio_out_minsize=2048;
34 sh->ds->ss_div = 1; // 1 samples/packet
35 sh->ds->ss_mul = 1; // 1 bytes/packet
34 return 1; 36 return 1;
35 } 37 }
36 38
37 static void uninit(sh_audio_t *sh) 39 static void uninit(sh_audio_t *sh)
38 { 40 {
59 int len; 61 int len;
60 int l=demux_read_data(sh_audio->ds,buf,minlen/2); 62 int l=demux_read_data(sh_audio->ds,buf,minlen/2);
61 unsigned short *d=(unsigned short *) buf; 63 unsigned short *d=(unsigned short *) buf;
62 unsigned char *s=buf; 64 unsigned char *s=buf;
63 len=2*l; 65 len=2*l;
64 if(sh_audio->format==6){ 66 if(sh_audio->format==6 || sh_audio->format==0x77616C61){
65 /* aLaw */ 67 /* aLaw */
66 while(l>0){ --l; d[l]=alaw2short[s[l]]; } 68 while(l>0){ --l; d[l]=alaw2short[s[l]]; }
67 } else { 69 } else {
68 /* uLaw */ 70 /* uLaw */
69 while(l>0){ --l; d[l]=ulaw2short[s[l]]; } 71 while(l>0){ --l; d[l]=ulaw2short[s[l]]; }