diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-15 22:56:22 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-24 13:35:03 +0300 |
commit | 16bb8247b45a51c06e27e8563d8a546f3dddc79e (patch) | |
tree | 9522fce749a98bb547e5e6292f804c25f0a8940d /libavcodec/qdm2.c | |
parent | ead313415037bbb94954a346a17796c0f741f790 (diff) |
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/qdm2.c')
-rw-r--r-- | libavcodec/qdm2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 657b2da64d..bd365739ce 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1604,11 +1604,12 @@ static av_cold void qdm2_init_static_data(void) { return; qdm2_init_vlc(); - ff_mpa_synth_init_float(ff_mpa_synth_window_float); softclip_table_init(); rnd_table_init(); init_noise_samples(); + ff_mpa_synth_init_float(); + done = 1; } |