[FFmpeg-devel] [PATCH 1/3] Add request_sample_fmt field to AVCodecContext to allow user to request a specific sample format from the audio decoder.

Justin Ruggles justin.ruggles
Thu Mar 10 20:45:47 CET 2011

On 03/10/2011 02:24 PM, Justin Ruggles wrote:

> +                /* set the requested input sample format if the output sample
> +                   format is different from the current input sample format
> +                   and the user has not already requested a sample format */
> +                if (codec->sample_fmt != icodec->sample_fmt) {
> +                    if (icodec->request_sample_fmt == AV_SAMPLE_FMT_NONE)
> +                        icodec->request_sample_fmt = codec->sample_fmt;
> +                }

I just realized that it would be better if ffmpeg would check the
supported sample formats and choose the best one out of the list.  For
example, if encoding to double, request float.  I'll send a new patch.


More information about the ffmpeg-devel mailing list