[FFmpeg-devel] [PATCH 4/6] avcodec/utils: Move decoder channel count check to ff_decode_preinit

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat Mar 20 19:22:45 EET 2021


Anton Khirnov:
> Quoting Andreas Rheinhardt (2021-03-16 21:30:58)
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
>> ---
>> I actually wonder why this flag is not used for encoders. Several of
>> them explicitly check for invalid channel values.
> 
> How would it work? How can the channel count _not_ be provided to an
> encoder?
> 
Seems you misunderstood my intentions. Or rather: Seems that what I
wrote actually doesn't convey my real intentions (unless you already
know my real intentions, of course). What I meant is: If the
"av_codec_is_decoder(codec)" check is omitted from the original check
and if "Decoder" in the message is replaced by "Codec", then this check
could have been used instead of having some encoders doing checks on
their own.
(I actually didn't even test what happens now with encoders that don't
check for channel_count == 0.)

- Andreas


More information about the ffmpeg-devel mailing list