aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegaudiodsp.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-15 16:01:49 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-24 11:35:03 +0100
commitead313415037bbb94954a346a17796c0f741f790 (patch)
treee03a09505d2d8e6987513cbff460819376e9f221 /libavcodec/mpegaudiodsp.c
parentb9c1ab89078d862e0146c9d7ed277addd770e3a3 (diff)
downloadffmpeg-ead313415037bbb94954a346a17796c0f741f790.tar.gz
avcodec/mpegaudiodsp: Make ff_mpadsp_init() thread-safe
The only thing missing for this is to make ff_mpadsp_init_x86() thread-safe; it currently isn't because a static table is initialized every time ff_mpadsp_init() is called (when ARCH_X86 is true). Solve this by initializing this table only once, namely together with the ordinary not-arch specific tables. This also allows to reuse their AVOnce. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpegaudiodsp.c')
-rw-r--r--libavcodec/mpegaudiodsp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c
index 0a14ff549e..f03e244644 100644
--- a/libavcodec/mpegaudiodsp.c
+++ b/libavcodec/mpegaudiodsp.c
@@ -73,6 +73,9 @@ static av_cold void mpadsp_init_tabs(void)
ff_mdct_win_fixed[j + 4][i + 1] = -ff_mdct_win_fixed[j][i + 1];
}
}
+
+ if (ARCH_X86)
+ ff_mpadsp_init_x86_tabs();
}
av_cold void ff_mpadsp_init(MPADSPContext *s)