avcodec/ffwavesynth: Fix backward lcg_seek()
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Jun 2019 20:08:27 +0000 (22:08 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 Jul 2019 09:43:06 +0000 (11:43 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cf2bd3ce79b12256d7d129b2ada5ee649b9a27eb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ffwavesynth.c

index a661139..cf8c780 100644 (file)
@@ -122,7 +122,7 @@ static void lcg_seek(uint32_t *s, int64_t dt)
         c = LCG_C;
     } else { /* coefficients for a step backward */
         a = LCG_AI;
-        c = (uint32_t)(LCG_AI * LCG_C);
+        c = (uint32_t)(-LCG_AI * LCG_C);
         dt = -dt;
     }
     while (dt) {