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