diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-15 20:56:22 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-24 11:35:03 +0100 |
commit | 16bb8247b45a51c06e27e8563d8a546f3dddc79e (patch) | |
tree | 9522fce749a98bb547e5e6292f804c25f0a8940d /libavcodec/mpegaudiodec_template.c | |
parent | ead313415037bbb94954a346a17796c0f741f790 (diff) | |
download | ffmpeg-16bb8247b45a51c06e27e8563d8a546f3dddc79e.tar.gz |
avcodec/mpegaudiodsp: Make initializing synth windows thread-safe
These arrays are used by the Musepack decoders, the MPEG audio decoders
as well as qdm2 and up until now, these arrays might be initialized more
than once, leading to potential data races as well as unnecessary
initializations. Therefore this commit ensures that each array will only
be initialized once.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpegaudiodec_template.c')
-rw-r--r-- | libavcodec/mpegaudiodec_template.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 12c1964446..849e3e5c09 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -289,8 +289,6 @@ static av_cold void decode_init_static(void) scale_factor_mult[i][2]); } - RENAME(ff_mpa_synth_init)(RENAME(ff_mpa_synth_window)); - /* huffman decode tables */ offset = 0; for (i = 1; i < 16; i++) { @@ -408,6 +406,7 @@ static av_cold void decode_init_static(void) csa_table[i][3] = ca - cs; #endif } + RENAME(ff_mpa_synth_init)(); } static av_cold int decode_init(AVCodecContext * avctx) |