summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec_template.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/aacdec_template.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/aacdec_template.c')
-rw-r--r--libavcodec/aacdec_template.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 70cffe6..82f4fb4 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;
OpenPOWER on IntegriCloud