Mercurial > mplayer.hg
annotate dec_audio.c @ 1013:74d55f3c4680
libao->libao2 because of conflict with OMS's libao
author | arpi_esp |
---|---|
date | Mon, 04 Jun 2001 21:00:47 +0000 |
parents | ef5d1ab14218 |
children | 72cacd3b8f30 |
rev | line source |
---|---|
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
1 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
2 #include <stdio.h> |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
3 #include <stdlib.h> |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
4 |
758 | 5 #include <sys/soundcard.h> |
6 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
7 #include "config.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
8 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
9 extern int verbose; // defined in mplayer.c |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
10 |
732
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
11 #ifdef USE_FAKE_MONO |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
12 int fakemono=0; |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
13 #endif |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
14 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
15 #include "stream.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
16 #include "demuxer.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
17 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
18 #include "wine/mmreg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
19 #include "wine/avifmt.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
20 #include "wine/vfw.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
21 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
22 #include "codec-cfg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
23 #include "stheader.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
24 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
25 #include "mp3lib/mp3.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
26 #include "libac3/ac3.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
27 |
883 | 28 #include "alaw.h" |
29 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
30 #include "xa/xa_gsm.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
31 |
604 | 32 #include "loader/DirectShow/DS_AudioDec.h" |
33 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
34 static sh_audio_t* ac3_audio_sh=NULL; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
35 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
36 // AC3 decoder buffer callback: |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
37 static void ac3_fill_buffer(uint8_t **start,uint8_t **end){ |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
38 int len=ds_get_packet(ac3_audio_sh->ds,start); |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
39 //printf("<ac3:%d>\n",len); |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
40 if(len<0) |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
41 *start = *end = NULL; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
42 else |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
43 *end = *start + len; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
44 } |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
45 |
296 | 46 |
47 int init_audio(sh_audio_t *sh_audio){ | |
303 | 48 |
49 int driver=sh_audio->codec->driver; | |
296 | 50 |
604 | 51 extern int init_acm_audio_codec(sh_audio_t *sh_audio); |
758 | 52 //extern int acm_decode_audio(sh_audio_t *sh_audio, void* a_buffer,int len); |
53 extern int acm_decode_audio(sh_audio_t *sh_audio, void* a_buffer,int minlen,int maxlen); | |
604 | 54 |
296 | 55 sh_audio->samplesize=2; |
758 | 56 sh_audio->sample_format=AFMT_S16_LE; |
303 | 57 sh_audio->samplerate=0; |
401 | 58 //sh_audio->pcm_bswap=0; |
303 | 59 |
758 | 60 sh_audio->a_buffer_size=0; |
303 | 61 sh_audio->a_buffer=NULL; |
296 | 62 |
746 | 63 sh_audio->a_in_buffer_len=0; |
64 | |
758 | 65 // setup required min. in/out buffer size: |
66 sh_audio->audio_out_minsize=8192;// default size, maybe not enough for Win32/ACM | |
67 | |
68 switch(driver){ | |
69 case 4: | |
296 | 70 // Win32 ACM audio codec: |
71 if(init_acm_audio_codec(sh_audio)){ | |
746 | 72 sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; |
296 | 73 sh_audio->channels=sh_audio->o_wf.nChannels; |
74 sh_audio->samplerate=sh_audio->o_wf.nSamplesPerSec; | |
758 | 75 // if(sh_audio->audio_out_minsize>16384) sh_audio->audio_out_minsize=16384; |
76 // sh_audio->a_buffer_size=sh_audio->audio_out_minsize; | |
77 // if(sh_audio->a_buffer_size<sh_audio->audio_out_minsize+MAX_OUTBURST) | |
78 // sh_audio->a_buffer_size=sh_audio->audio_out_minsize+MAX_OUTBURST; | |
296 | 79 } else { |
80 printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n"); | |
303 | 81 driver=0; |
296 | 82 } |
758 | 83 break; |
84 case 7: | |
296 | 85 #ifndef USE_DIRECTSHOW |
86 printf("Compiled without DirectShow support -> force nosound :(\n"); | |
303 | 87 driver=0; |
296 | 88 #else |
89 // Win32 DShow audio codec: | |
340 | 90 // printf("DShow_audio: channs=%d rate=%d\n",sh_audio->channels,sh_audio->samplerate); |
432
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
91 if(DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,sh_audio->wf)){ |
303 | 92 printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",sh_audio->codec->dll); |
93 driver=0; | |
94 } else { | |
746 | 95 sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; |
432
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
96 sh_audio->channels=sh_audio->wf->nChannels; |
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
97 sh_audio->samplerate=sh_audio->wf->nSamplesPerSec; |
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
98 sh_audio->audio_in_minsize=2*sh_audio->wf->nBlockAlign; |
296 | 99 if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; |
100 sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize; | |
101 sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size); | |
102 sh_audio->a_in_buffer_len=0; | |
758 | 103 sh_audio->audio_out_minsize=16384; |
296 | 104 } |
105 #endif | |
758 | 106 break; |
107 case 2: | |
108 case 8: | |
109 case 5: | |
110 // PCM, aLaw | |
111 sh_audio->audio_out_minsize=2048; | |
112 break; | |
113 case 3: | |
114 // Dolby AC3 audio: | |
115 sh_audio->audio_out_minsize=4*256*6; | |
116 break; | |
117 case 6: | |
118 // MS-GSM audio codec: | |
119 sh_audio->audio_out_minsize=4*320; | |
120 break; | |
121 case 1: | |
122 // MPEG Audio: | |
123 sh_audio->audio_out_minsize=4608; | |
124 break; | |
296 | 125 } |
126 | |
303 | 127 if(!driver) return 0; |
296 | 128 |
129 // allocate audio out buffer: | |
758 | 130 sh_audio->a_buffer_size=sh_audio->audio_out_minsize+MAX_OUTBURST; // worst case calc. |
131 | |
132 printf("dec_audio: Allocating %d + %d = %d bytes for output buffer\n", | |
133 sh_audio->audio_out_minsize,MAX_OUTBURST,sh_audio->a_buffer_size); | |
134 | |
296 | 135 sh_audio->a_buffer=malloc(sh_audio->a_buffer_size); |
758 | 136 if(!sh_audio->a_buffer){ |
137 printf("Cannot allocate audio out buffer\n"); | |
138 return 0; | |
139 } | |
296 | 140 memset(sh_audio->a_buffer,0,sh_audio->a_buffer_size); |
141 sh_audio->a_buffer_len=0; | |
142 | |
303 | 143 switch(driver){ |
144 case 4: { | |
758 | 145 int ret=acm_decode_audio(sh_audio,sh_audio->a_buffer,4096,sh_audio->a_buffer_size); |
296 | 146 if(ret<0){ |
303 | 147 printf("ACM decoding error: %d\n",ret); |
148 driver=0; | |
296 | 149 } |
640 | 150 sh_audio->a_buffer_len=ret; |
303 | 151 break; |
296 | 152 } |
303 | 153 case 2: { |
296 | 154 // AVI PCM Audio: |
432
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
155 WAVEFORMATEX *h=sh_audio->wf; |
746 | 156 sh_audio->i_bps=h->nAvgBytesPerSec; |
296 | 157 sh_audio->channels=h->nChannels; |
158 sh_audio->samplerate=h->nSamplesPerSec; | |
159 sh_audio->samplesize=(h->wBitsPerSample+7)/8; | |
758 | 160 switch(sh_audio->format){ // hardware formats: |
161 case 0x6: sh_audio->sample_format=AFMT_A_LAW;break; | |
162 case 0x7: sh_audio->sample_format=AFMT_MU_LAW;break; | |
163 case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break; | |
164 case 0x50: sh_audio->sample_format=AFMT_MPEG;break; | |
165 // case 0x2000: sh_audio->sample_format=AFMT_AC3; | |
166 default: sh_audio->sample_format=(sh_audio->samplesize==2)?AFMT_S16_LE:AFMT_U8; | |
167 } | |
401 | 168 break; |
169 } | |
170 case 8: { | |
171 // DVD PCM Audio: | |
172 sh_audio->channels=2; | |
173 sh_audio->samplerate=48000; | |
746 | 174 sh_audio->i_bps=2*2*48000; |
296 | 175 // sh_audio->pcm_bswap=1; |
303 | 176 break; |
177 } | |
178 case 3: { | |
296 | 179 // Dolby AC3 audio: |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
180 ac3_audio_sh=sh_audio; // save sh_audio for the callback: |
296 | 181 ac3_config.fill_buffer_callback = ac3_fill_buffer; |
182 ac3_config.num_output_ch = 2; | |
183 ac3_config.flags = 0; | |
184 #ifdef HAVE_MMX | |
185 ac3_config.flags |= AC3_MMX_ENABLE; | |
186 #endif | |
187 #ifdef HAVE_3DNOW | |
188 ac3_config.flags |= AC3_3DNOW_ENABLE; | |
189 #endif | |
190 ac3_init(); | |
191 sh_audio->ac3_frame = ac3_decode_frame(); | |
192 if(sh_audio->ac3_frame){ | |
746 | 193 ac3_frame_t* fr=(ac3_frame_t*)sh_audio->ac3_frame; |
194 sh_audio->samplerate=fr->sampling_rate; | |
296 | 195 sh_audio->channels=2; |
746 | 196 // 1 frame: 6*256 samples 1 sec: sh_audio->samplerate samples |
197 //sh_audio->i_bps=fr->frame_size*fr->sampling_rate/(6*256); | |
198 sh_audio->i_bps=fr->bit_rate*(1000/8); | |
303 | 199 } else { |
200 driver=0; // bad frame -> disable audio | |
201 } | |
202 break; | |
203 } | |
204 case 5: { | |
296 | 205 // aLaw audio codec: |
432
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
206 sh_audio->channels=sh_audio->wf->nChannels; |
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
207 sh_audio->samplerate=sh_audio->wf->nSamplesPerSec; |
746 | 208 sh_audio->i_bps=sh_audio->channels*sh_audio->samplerate; |
303 | 209 break; |
210 } | |
211 case 6: { | |
296 | 212 // MS-GSM audio codec: |
213 GSM_Init(); | |
432
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
214 sh_audio->channels=sh_audio->wf->nChannels; |
5251b0c57e39
sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents:
401
diff
changeset
|
215 sh_audio->samplerate=sh_audio->wf->nSamplesPerSec; |
746 | 216 // decodes 65 byte -> 320 short |
217 // 1 sec: sh_audio->channels*sh_audio->samplerate samples | |
218 // 1 frame: 320 samples | |
219 sh_audio->i_bps=65*(sh_audio->channels*sh_audio->samplerate)/320; // 1:10 | |
303 | 220 break; |
296 | 221 } |
303 | 222 case 1: { |
296 | 223 // MPEG Audio: |
732
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
224 #ifdef USE_FAKE_MONO |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
225 MP3_Init(fakemono); |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
226 #else |
296 | 227 MP3_Init(); |
732
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
228 #endif |
296 | 229 MP3_samplerate=MP3_channels=0; |
230 // printf("[\n"); | |
231 sh_audio->a_buffer_len=MP3_DecodeFrame(sh_audio->a_buffer,-1); | |
232 // printf("]\n"); | |
233 sh_audio->channels=2; // hack | |
234 sh_audio->samplerate=MP3_samplerate; | |
746 | 235 sh_audio->i_bps=MP3_bitrate*(1000/8); |
303 | 236 break; |
237 } | |
296 | 238 } |
239 | |
240 if(!sh_audio->channels || !sh_audio->samplerate){ | |
241 printf("Unknown/missing audio format, using nosound\n"); | |
303 | 242 driver=0; |
296 | 243 } |
244 | |
303 | 245 if(!driver){ |
246 if(sh_audio->a_buffer) free(sh_audio->a_buffer); | |
247 sh_audio->o_bps=0; | |
248 return 0; | |
249 } | |
296 | 250 |
303 | 251 sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize; |
252 return driver; | |
296 | 253 } |
291 | 254 |
746 | 255 // Audio decoding: |
291 | 256 |
746 | 257 // Decode a single frame (mp3,acm etc) or 'minlen' bytes (pcm/alaw etc) |
258 // buffer length is 'maxlen' bytes, it shouldn't be exceeded... | |
259 | |
260 int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen){ | |
291 | 261 int len=-1; |
303 | 262 switch(sh_audio->codec->driver){ |
291 | 263 case 1: // MPEG layer 2 or 3 |
264 len=MP3_DecodeFrame(buf,-1); | |
296 | 265 sh_audio->channels=2; // hack |
291 | 266 break; |
401 | 267 case 2: // AVI PCM |
746 | 268 { len=demux_read_data(sh_audio->ds,buf,minlen); |
401 | 269 break; |
270 } | |
271 case 8: // DVD PCM | |
272 { int j; | |
746 | 273 len=demux_read_data(sh_audio->ds,buf,minlen); |
291 | 274 //if(i&1){ printf("Warning! pcm_audio_size&1 !=0 (%d)\n",i);i&=~1; } |
746 | 275 // swap endian: |
291 | 276 for(j=0;j<len;j+=2){ |
277 char x=buf[j]; | |
278 buf[j]=buf[j+1]; | |
279 buf[j+1]=x; | |
280 } | |
281 break; | |
282 } | |
283 case 5: // aLaw decoder | |
746 | 284 { int l=demux_read_data(sh_audio->ds,buf,minlen/2); |
291 | 285 unsigned short *d=(unsigned short *) buf; |
286 unsigned char *s=buf; | |
287 len=2*l; | |
758 | 288 if(sh_audio->format==6){ |
289 // aLaw | |
883 | 290 while(l>0){ --l; d[l]=alaw2short[s[l]]; } |
758 | 291 } else { |
292 // uLaw | |
883 | 293 while(l>0){ --l; d[l]=ulaw2short[s[l]]; } |
291 | 294 } |
295 break; | |
296 } | |
297 case 6: // MS-GSM decoder | |
298 { unsigned char buf[65]; // 65 bytes / frame | |
746 | 299 if(demux_read_data(sh_audio->ds,buf,65)!=65) break; // EOF |
300 XA_MSGSM_Decoder(buf,(unsigned short *) buf); // decodes 65 byte -> 320 short | |
301 // XA_GSM_Decoder(buf,(unsigned short *) &sh_audio->a_buffer[sh_audio->a_buffer_len]); // decodes 33 byte -> 160 short | |
302 len=2*320; | |
291 | 303 break; |
304 } | |
305 case 3: // AC3 decoder | |
306 //printf("{1:%d}",avi_header.idx_pos);fflush(stdout); | |
307 if(!sh_audio->ac3_frame) sh_audio->ac3_frame=ac3_decode_frame(); | |
308 //printf("{2:%d}",avi_header.idx_pos);fflush(stdout); | |
309 if(sh_audio->ac3_frame){ | |
296 | 310 len = 256 * 6 *sh_audio->channels*sh_audio->samplesize; |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
311 memcpy(buf,((ac3_frame_t*)sh_audio->ac3_frame)->audio_data,len); |
291 | 312 sh_audio->ac3_frame=NULL; |
313 } | |
314 //printf("{3:%d}",avi_header.idx_pos);fflush(stdout); | |
315 break; | |
316 case 4: | |
758 | 317 // len=sh_audio->audio_out_minsize; // optimal decoded fragment size |
318 // if(len<minlen) len=minlen; else | |
319 // if(len>maxlen) len=maxlen; | |
320 // len=acm_decode_audio(sh_audio,buf,len); | |
321 len=acm_decode_audio(sh_audio,buf,minlen,maxlen); | |
291 | 322 break; |
746 | 323 |
291 | 324 #ifdef USE_DIRECTSHOW |
325 case 7: // DirectShow | |
326 { int ret; | |
327 int size_in=0; | |
328 int size_out=0; | |
329 int srcsize=DS_AudioDecoder_GetSrcSize(maxlen); | |
330 if(verbose>2)printf("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); | |
331 if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! | |
332 if(sh_audio->a_in_buffer_len<srcsize){ | |
333 sh_audio->a_in_buffer_len+= | |
334 demux_read_data(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], | |
335 srcsize-sh_audio->a_in_buffer_len); | |
336 } | |
337 DS_AudioDecoder_Convert(sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, | |
338 buf,maxlen, &size_in,&size_out); | |
754 | 339 if(verbose) |
340 printf("DShow: audio %d -> %d converted (in_buf_len=%d of %d) %d\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,ds_tell_pts(sh_audio->ds)); | |
291 | 341 if(size_in>=sh_audio->a_in_buffer_len){ |
342 sh_audio->a_in_buffer_len=0; | |
343 } else { | |
344 sh_audio->a_in_buffer_len-=size_in; | |
345 memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); | |
346 } | |
347 len=size_out; | |
348 break; | |
349 } | |
350 #endif | |
351 } | |
352 return len; | |
353 } | |
354 | |
355 |