diff mbox series

[FFmpeg-devel,v2,12/27] avcodec/wavpack: Move initializing DSD data to a better place

Message ID GV1P250MB0737B45304110B327CAABBCA8F002@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 8dd0bd4f9b8de59c2731215f1611f337a19474cb
Headers show
Series [FFmpeg-devel,v2,01/27] avcodec/threadprogress: Add new API for frame-threaded progress | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 8, 2024, 8:13 p.m. UTC
Namely to code that is only executed if we are indeed
initializing a DSD context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/wavpack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 83f42f392d..6fd297a002 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1011,6 +1011,8 @@  static int wv_dsd_reset(WavpackContext *s, int channels)
     for (i = 0; i < channels; i++)
         memset(s->dsdctx[i].buf, 0x69, sizeof(s->dsdctx[i].buf));
 
+    ff_init_dsd_data();
+
     return 0;
 }
 
@@ -1533,7 +1535,6 @@  static int wavpack_decode_block(AVCodecContext *avctx, AVFrame *frame, int block
                 av_log(avctx, AV_LOG_ERROR, "Error reinitializing the DSD context\n");
                 return ret;
             }
-            ff_init_dsd_data();
         }
         av_channel_layout_copy(&avctx->ch_layout, &new_ch_layout);
         avctx->sample_rate         = new_samplerate;