diff mbox series

[FFmpeg-devel,170/191] avcodec/nellymoserdec: Make decoder init-threadsafe

Message ID 20201123193739.1249300-8-andreas.rheinhardt@gmail.com
State Accepted
Commit 35f61eb3507ebb746cba1cc14ca8a280b9f258ed
Headers show
Series VLC, esp. init_vlc patches | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 23, 2020, 7:37 p.m. UTC
Easy now that initializing the ff_sine_* tables is thread-safe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/nellymoserdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index d667d9ce79..49a21b43ce 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -128,13 +128,12 @@  static av_cold int decode_init(AVCodecContext * avctx) {
     s->scale_bias = 1.0/(32768*8);
     avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
-    /* Generate overlap window */
-    if (!ff_sine_128[127])
-        ff_init_ff_sine_windows(7);
-
     avctx->channels       = 1;
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
 
+    /* Generate overlap window */
+    ff_init_ff_sine_windows(7);
+
     return 0;
 }
 
@@ -198,4 +197,5 @@  AVCodec ff_nellymoser_decoder = {
     .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE,
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
                                                       AV_SAMPLE_FMT_NONE },
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };