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/aacdec_template.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libavcodec/aacdec_template.c') diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 70cffe6a92..82f4fb44ac 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1103,14 +1103,12 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(cbrt_tableinit)(); } -static AVOnce aac_init = AV_ONCE_INIT; - static av_cold int aac_decode_init(AVCodecContext *avctx) { AACContext *ac = avctx->priv_data; int ret; - ret = ff_thread_once(&aac_init, &aac_static_table_init); + ret = ff_thread_once(&aac_table_init, &aac_static_table_init); if (ret != 0) return AVERROR_UNKNOWN; -- cgit v1.2.3