[FFmpeg-devel] [PATCH] convert to S16 when resampling is requested
Sat Jan 31 19:53:04 CET 2009
> + AVAudioConvert *convert_ctx;
> + enum SampleFormat sample_fmt; ///< input sample format
> + unsigned sample_size; ///< size of one sample in
> + short *buffer; ///< buffers used for conversion
> to S16
> + unsigned buffer_size; ///< sizes of allocated buffers
If you convert back, you could end up with three convert contexts if
the output format doesn't like S16. I did this with one convert
context in resample.c and most of the time it doesn't have to convert
after resampling since the encoder likes S16 anyways.
Ideally, the resampling should be part of the converter. Then you
could remove the resampling code in ffmpeg.c and simplify the API a bit.
More information about the ffmpeg-devel