# HG changeset patch # User uau # Date 1193899943 0 # Node ID bc6132465897ee018f0bdb558d1d009c5b22358f # Parent 80180dc13565bc7c4ac1d6e55d2554a06dc4e592 audio: simplify buffer allocation code Remove the code allocating sh_audio->a_out_buffer from init_audio_filters() and let the buffer be allocated by the new dynamic allocation code. diff -r 80180dc13565 -r bc6132465897 libmpcodecs/dec_audio.c --- a/libmpcodecs/dec_audio.c Thu Nov 01 06:52:19 2007 +0000 +++ b/libmpcodecs/dec_audio.c Thu Nov 01 06:52:23 2007 +0000 @@ -363,19 +363,8 @@ *out_channels = afs->output.nch; *out_format = afs->output.format; - if (out_maxsize || out_minsize) { - // allocate the a_out_* buffers: - if (out_maxsize < out_minsize) - out_maxsize = out_minsize; - if (out_maxsize < 8192) - out_maxsize = MAX_OUTBURST; // not sure this is ok + sh_audio->a_out_buffer_len = 0; - sh_audio->a_out_buffer_size = out_maxsize; - free(sh_audio->a_out_buffer); - sh_audio->a_out_buffer = memalign(16, sh_audio->a_out_buffer_size); - memset(sh_audio->a_out_buffer, 0, sh_audio->a_out_buffer_size); - sh_audio->a_out_buffer_len = 0; - } // ok! sh_audio->afilter = (void *) afs; return 1;