]> git.sesse.net Git - ffmpeg/commitdiff
opusenc: initialize PVQ prng seed
authorRostislav Pehlivanov <atomnuker@gmail.com>
Wed, 10 May 2017 05:07:46 +0000 (06:07 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 16 May 2017 10:22:07 +0000 (11:22 +0100)
Fixes valgrind warnings, didn't affect anything since it was only used
for resynthesis.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/opusenc.c

index 5f5700ea50165c9480de704a3edaa85cd0dc1412..41e1a3fb3877bab246b72ef6cb0e6eff123d95e2 100644 (file)
@@ -1083,8 +1083,10 @@ static av_cold int opus_encode_init(AVCodecContext *avctx)
         if ((ret = ff_mdct15_init(&s->mdct[i], 0, i + 3, 68 << (CELT_BLOCK_NB - 1 - i))))
             return AVERROR(ENOMEM);
 
-    for (i = 0; i < OPUS_MAX_FRAMES_PER_PACKET; i++)
+    for (i = 0; i < OPUS_MAX_FRAMES_PER_PACKET; i++) {
         s->frame[i].block[0].emph_coeff = s->frame[i].block[1].emph_coeff = 0.0f;
+        s->frame[i].seed = 0;
+    }
 
     /* Zero out previous energy (matters for inter first frame) */
     for (ch = 0; ch < s->channels; ch++)