[FFmpeg-devel] audio_resample* API questions

Stefano Sabatini stefano.sabatini-lala
Mon Jul 21 16:40:39 CEST 2008

Hi all,

there is some reason for which the following block of audio_resample()
is deactivated: 

    if (s->input_channels == s->output_channels && s->ratio == 1.0 && 0) {
        /* nothing to do */
        memcpy(output, input, nb_samples * s->input_channels * sizeof(short));
        return nb_samples;


BTW what is the user supposed to do in the case the input buffer isn't
consumed completely?

In this case part of the input buffer is stored in the temporary
buffer of ReSampleContext, the only way to notice this seems to use
the returned value of audio_resample() and compare it with the
expected value if all the input buffer is resampled (and which require
to compute the ratio again).

Also what about to provide some function to expose for example the
ReSampleContext ratio, which in many application has otherwise to be
computed again?

FFmpeg = Free Friendly MultiPurpose Ecumenical Guru

More information about the ffmpeg-devel mailing list