Quoting Andreas Rheinhardt (2020-11-29 00:28:51) > ff_slice_thread_init() uses a static variable to hold a function > pointer, although the value of said pointer needn't be saved between > different runs of this function at all; > > The reason for this being so is probably that said pointer points to > a static function (if used); but storage class specifiers like "static" > are not part of the type of an object and so including it in the pointer > declaration is wrong (anyway, "static" means different things in both > contexts: for the function declaration it affects linkage, for the > variable storage duration). > > Using a static variable here can lead to races, e.g. when initializing > VP9 (for which said function pointer was added) and H.264 with slice > threading. The latter has the FF_CODEC_CAP_INIT_THREADSAFE flag set and > is therefore unaffected by the lock guarding initializations of > decoders. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> > ---
Looks very good. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".