From 3d62e7a30fa552be52d12b31e3e0f79153aff891 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Fri, 27 Nov 2015 14:52:35 +0000 Subject: aacenc: make threadsafe Since the ff_aac_tableinit() can be called by both the encoder and the decoder (in case of transcoding) this commit shares the AVOnce variable to prevent this. Signed-off-by: Rostislav Pehlivanov --- libavcodec/aactab.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/aactab.c') diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index dc9acc1bf3..c6e797ecbf 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -27,12 +27,15 @@ * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ +#include "libavutil/thread.h" #include "libavutil/mem.h" #include "aac.h" #include "aac_tablegen.h" #include +AVOnce aac_table_init = AV_ONCE_INIT; + DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024]; DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; DECLARE_ALIGNED(32, int, ff_aac_kbd_long_1024_fixed)[1024]; -- cgit v1.2.3