avfilter/af_adelay: fix buggy behaviour
authorPaul B Mahol <onemda@gmail.com>
Wed, 9 Oct 2019 07:56:33 +0000 (09:56 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 9 Oct 2019 07:56:33 +0000 (09:56 +0200)
libavfilter/af_adelay.c

index 06e39fa..c964777 100644 (file)
@@ -165,9 +165,9 @@ static int config_input(AVFilterLink *inlink)
         }
     }
 
-    if (s->all) {
-        for (int j = i + 1; j < s->nb_delays; j++)
-            s->chandelay[j].delay = s->chandelay[i].delay;
+    if (s->all && i) {
+        for (int j = i; j < s->nb_delays; j++)
+            s->chandelay[j].delay = s->chandelay[i-1].delay;
     }
 
     s->padding = s->chandelay[0].delay;