free(bufin[0]); free(bufin[1]);  free(bufout[0]); free(bufout[1]);
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples){    int i, nb_samples1;    short bufin[2][nb_samples];    short bufout[2][(int)(nb_samples * s->ratio) + 16]; /* make some zoom to avoid round pb */    short *buftmp2[2], *buftmp3[2];    if (s->input_channels == s->output_channels && s->ratio == 1.0) {        /* nothing to do */        memcpy(output, input, nb_samples * s->input_channels * sizeof(short));        return nb_samples;    }    if (s->input_channels == 2 &&        s->output_channels == 1) {        buftmp2[0] = bufin[0];        buftmp3[0] = output;        stereo_to_mono(buftmp2[0], input, nb_samples);    } else if (s->output_channels == 2 && s->input_channels == 1) {        buftmp2[0] = input;        buftmp3[0] = bufout[0];    } else if (s->output_channels == 2) {        buftmp2[0] = bufin[0];        buftmp2[1] = bufin[1];        buftmp3[0] = bufout[0];        buftmp3[1] = bufout[1];        stereo_split(buftmp2[0], buftmp2[1], input, nb_samples);    } else {        buftmp2[0] = input;        buftmp3[0] = output;    }    /* resample each channel */    nb_samples1 = 0; /* avoid warning */    for(i=0;i<s->filter_channels;i++) {        nb_samples1 = mono_resample(&s->channel_ctx[i], buftmp3[i], buftmp2[i], nb_samples);    }    if (s->output_channels == 2 && s->input_channels == 1) {        mono_to_stereo(output, buftmp3[0], nb_samples1);    } else if (s->output_channels == 2) {        stereo_mux(output, buftmp3[0], buftmp3[1], nb_samples1);    }    return nb_samples1;}