[FFmpeg-devel] [PATCH 21/42] avcodec/refstruct: Allow to always return zeroed pool entries

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Oct 12 16:25:14 EEST 2023


Anton Khirnov:
> Quoting Andreas Rheinhardt (2023-09-19 21:57:13)
>> diff --git a/libavcodec/refstruct.h b/libavcodec/refstruct.h
>> Furthermore, it also makes the pool behave as if the
>> FF_REFSTRUCT_POOL_FLAG_NO_ZEROING flag had been provided.
> 
> What does this imply for the caller?
> 

It means that if you have an init callback, that the object has not been
zeroed before it is given to you. So the init function would probably be
only useful for logging. If you don't have an init callback at all, you
won't notice the difference.
The rationale for this behaviour is that it makes no sense to zero
initially if it is zeroed generically before every use and I want to
spare the user to set the FF_REFSTRUCT_POOL_FLAG_NO_ZEROING flag (which
could be easily forgotten).

- Andreas



More information about the ffmpeg-devel mailing list