[FFmpeg-devel] [PATCH v2 7/7] avcodec: add AV_CODEC_FLAG_CLEAR

Anton Khirnov anton at khirnov.net
Thu Dec 14 10:03:33 EET 2023


Quoting Marton Balint (2023-12-13 18:09:45)
> On Wed, 13 Dec 2023, Anton Khirnov wrote:
> > Quoting Marton Balint (2023-12-12 19:37:57)
> >>
> >> So for this flag, I'd rather make it clear it is not security-related, and
> >> also that it has performance impact.
> >
> > So then maybe make a FF_EC flag?
> 
> I thought about using that, but there are plenty of error concealment 
> code which only checks if avctx->error_concealment is nonzero or zero, and 
> not specific EC flags. So unless that is fixed (which might break existing 
> behaviour) one cannot introduce a new EC flag and disable error 
> concealment at the same time...

If you don't feel like fixing all the places that do such checks, you
could instead
* add a flag in DecodeContext
* in ff_decode_preinit(), map your new FF_EC_PREDECODE_CLEAR to the
  internal flag
* clear FF_EC_PREDECODE_CLEAR in AVCodecContext

That should avoid breaking any existing behavior.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list