summaryrefslogtreecommitdiffstats
path: root/libavcodec/aactab.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-11-27 14:52:35 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-11-27 14:52:35 +0000
commit3d62e7a30fa552be52d12b31e3e0f79153aff891 (patch)
tree0aca26f2b4029afb989bee72c27c10f14a3c9405 /libavcodec/aactab.c
parent8000d484b83aafa752d84fbdbfb352ffe0dc64f8 (diff)
downloadffmpeg-streaming-3d62e7a30fa552be52d12b31e3e0f79153aff891.zip
ffmpeg-streaming-3d62e7a30fa552be52d12b31e3e0f79153aff891.tar.gz
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 <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aactab.c')
-rw-r--r--libavcodec/aactab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c
index dc9acc1..c6e797e 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 <stdint.h>
+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];
OpenPOWER on IntegriCloud