[FFmpeg-devel] Make ffmpeg.c and ffplay.c use avctx->request_channels

Andreas Öman andreas
Wed Dec 12 14:32:57 CET 2007


Michael Niedermayer wrote:
> you assume that every codec with >2 chans can downmix this is likely not the
> case
> a CODEC_CAP_DOWNMIX could be added or just check the channels number after
> avcodec_open()

Hm, yes, this is not so good.

Another option is to make request_channels 'advisory' only.

Ie. if the decoder cannot satisfy the requirement or just don't
know about any downmixing then avctx->channels will stay

It is then up to the caller to check if "avctx->channels" has
the desired value. (bail out, or invoke a "dumb" downmixer)

If so, I would suggest that we move the guts of audio resampling setup
into do_audio_out() and do this on demand (based on the outcome
of decoding)


More information about the ffmpeg-devel mailing list