Mercurial > mplayer.hg
annotate dec_audio.c @ 1166:95f6f14176c6
fr->sampling_frequency limitation (thanx to pl <p_l@tfz.net>)
author | arpi_esp |
---|---|
date | Tue, 19 Jun 2001 22:07:19 +0000 |
parents | cab5ba9ffc6c |
children | 3f490fad9bdf |
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 |
1038
b36fb1ae4b53
applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents:
1020
diff
changeset
|
5 #include "config.h" |
1058 | 6 #include "libao2/afmt.h" |
758 | 7 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
8 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
|
9 |
732
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
10 #ifdef USE_FAKE_MONO |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
11 int fakemono=0; |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
12 #endif |
e14114170e01
applied 'fakemono' patch by Bryan Chan scorpio@acm.org
arpi_esp
parents:
640
diff
changeset
|
13 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
14 #include "stream.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
15 #include "demuxer.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
16 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
17 #include "wine/mmreg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
18 #include "wine/avifmt.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
19 #include "wine/vfw.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
20 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
21 #include "codec-cfg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
22 #include "stheader.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
23 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
24 #include "mp3lib/mp3.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
25 #include "libac3/ac3.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
26 |
883 | 27 #include "alaw.h" |
28 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
29 #include "xa/xa_gsm.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
30 |
604 | 31 #include "loader/DirectShow/DS_AudioDec.h" |
32 | |
1038
b36fb1ae4b53
applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents:
1020
diff
changeset
|
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); | |
265 break; | |
401 | 266 case 2: // AVI PCM |
1058 | 267 len=demux_read_data(sh_audio->ds,buf,minlen); |
401 | 268 break; |
269 case 8: // DVD PCM | |
270 { int j; | |
746 | 271 len=demux_read_data(sh_audio->ds,buf,minlen); |
291 | 272 //if(i&1){ printf("Warning! pcm_audio_size&1 !=0 (%d)\n",i);i&=~1; } |
746 | 273 // swap endian: |
291 | 274 for(j=0;j<len;j+=2){ |
275 char x=buf[j]; | |
276 buf[j]=buf[j+1]; | |
277 buf[j+1]=x; | |
278 } | |
279 break; | |
280 } | |
281 case 5: // aLaw decoder | |
746 | 282 { int l=demux_read_data(sh_audio->ds,buf,minlen/2); |
291 | 283 unsigned short *d=(unsigned short *) buf; |
284 unsigned char *s=buf; | |
285 len=2*l; | |
758 | 286 if(sh_audio->format==6){ |
287 // aLaw | |
883 | 288 while(l>0){ --l; d[l]=alaw2short[s[l]]; } |
758 | 289 } else { |
290 // uLaw | |
883 | 291 while(l>0){ --l; d[l]=ulaw2short[s[l]]; } |
291 | 292 } |
293 break; | |
294 } | |
295 case 6: // MS-GSM decoder | |
296 { unsigned char buf[65]; // 65 bytes / frame | |
746 | 297 if(demux_read_data(sh_audio->ds,buf,65)!=65) break; // EOF |
298 XA_MSGSM_Decoder(buf,(unsigned short *) buf); // decodes 65 byte -> 320 short | |
299 // XA_GSM_Decoder(buf,(unsigned short *) &sh_audio->a_buffer[sh_audio->a_buffer_len]); // decodes 33 byte -> 160 short | |
300 len=2*320; | |
291 | 301 break; |
302 } | |
303 case 3: // AC3 decoder | |
304 //printf("{1:%d}",avi_header.idx_pos);fflush(stdout); | |
305 if(!sh_audio->ac3_frame) sh_audio->ac3_frame=ac3_decode_frame(); | |
306 //printf("{2:%d}",avi_header.idx_pos);fflush(stdout); | |
307 if(sh_audio->ac3_frame){ | |
296 | 308 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
|
309 memcpy(buf,((ac3_frame_t*)sh_audio->ac3_frame)->audio_data,len); |
291 | 310 sh_audio->ac3_frame=NULL; |
311 } | |
312 //printf("{3:%d}",avi_header.idx_pos);fflush(stdout); | |
313 break; | |
314 case 4: | |
758 | 315 // len=sh_audio->audio_out_minsize; // optimal decoded fragment size |
316 // if(len<minlen) len=minlen; else | |
317 // if(len>maxlen) len=maxlen; | |
318 // len=acm_decode_audio(sh_audio,buf,len); | |
319 len=acm_decode_audio(sh_audio,buf,minlen,maxlen); | |
291 | 320 break; |
746 | 321 |
291 | 322 #ifdef USE_DIRECTSHOW |
323 case 7: // DirectShow | |
324 { int ret; | |
325 int size_in=0; | |
326 int size_out=0; | |
327 int srcsize=DS_AudioDecoder_GetSrcSize(maxlen); | |
328 if(verbose>2)printf("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); | |
329 if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! | |
330 if(sh_audio->a_in_buffer_len<srcsize){ | |
331 sh_audio->a_in_buffer_len+= | |
332 demux_read_data(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len], | |
333 srcsize-sh_audio->a_in_buffer_len); | |
334 } | |
335 DS_AudioDecoder_Convert(sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, | |
336 buf,maxlen, &size_in,&size_out); | |
754 | 337 if(verbose) |
338 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 | 339 if(size_in>=sh_audio->a_in_buffer_len){ |
340 sh_audio->a_in_buffer_len=0; | |
341 } else { | |
342 sh_audio->a_in_buffer_len-=size_in; | |
343 memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); | |
344 } | |
345 len=size_out; | |
346 break; | |
347 } | |
348 #endif | |
349 } | |
350 return len; | |
351 } | |
352 | |
353 |