diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-30 23:58:56 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-05-02 05:14:41 +0200 |
commit | 7d4f1f4d99a95e30a7d5b85dc591e388b2f9f3bd (patch) | |
tree | d441cc73c1effa4aa8074fad349b9507133844d1 /libavcodec/dca_lbr.c | |
parent | e5bc8b623661db80e854765d7ac359764b0d0760 (diff) | |
download | ffmpeg-7d4f1f4d99a95e30a7d5b85dc591e388b2f9f3bd.tar.gz |
avcodec/dca*: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/dca_lbr.c')
-rw-r--r-- | libavcodec/dca_lbr.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index 2f8060df89..481a8df7e6 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -124,21 +124,15 @@ static const uint16_t channel_layouts[7] = { static float cos_tab[256]; static float lpc_tab[16]; -static av_cold void init_tables(void) +av_cold void ff_dca_lbr_init_tables(void) { - static int initialized; int i; - if (initialized) - return; - for (i = 0; i < 256; i++) cos_tab[i] = cos(M_PI * i / 128); for (i = 0; i < 16; i++) lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))); - - initialized = 1; } static int parse_lfe_24(DCALbrDecoder *s) @@ -1818,8 +1812,6 @@ av_cold void ff_dca_lbr_flush(DCALbrDecoder *s) av_cold int ff_dca_lbr_init(DCALbrDecoder *s) { - init_tables(); - if (!(s->fdsp = avpriv_float_dsp_alloc(0))) return AVERROR(ENOMEM); |