On 12/11/2020 20:51, Andreas Rheinhardt wrote: > The ff_init_vlc_... functions are inherently thread-safe: Everything is > modified only once and directly set to its final value; so it's no > problem if two threads are initializing the same static VLC at the same > time.
Hmm, indeed. At the very least it is doing repeated work and allocations on every init that needn't happen. Wrapping in ff_thread_once is still preferable IMO... Unrelatedly: It looks like buf may not be freed when ff_init_vlc_from_lengths is called with INIT_VLC_USE_NEW_STATIC with more than LOCALBUF_ELEMS (which while currently set to something higher than the max used, could accidentally be called with more than 1500 in the future.) There should be fixed, or maybe be an assert added so that nobody ends up doing that in the first place by accident. - Derek _______________________________________________ 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".