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

Anton Khirnov anton at khirnov.net
Thu Oct 12 16:56:52 EEST 2023


Quoting Andreas Rheinhardt (2023-10-12 15:25:14)
> 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).

Can you mention this in the docs then?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list