]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_adelay.c
avfilter/vf_v360: add mask option, unset pixels are marked as transparent
[ffmpeg] / libavfilter / af_adelay.c
index eb97039566d7169867e0eb90b51046fd4d4962b2..c9647771f2e203d8b4973f2be06f1a32e11902b8 100644 (file)
@@ -36,6 +36,7 @@ typedef struct ChanDelay {
 
 typedef struct AudioDelayContext {
     const AVClass *class;
+    int all;
     char *delays;
     ChanDelay *chandelay;
     int nb_delays;
@@ -54,6 +55,7 @@ typedef struct AudioDelayContext {
 
 static const AVOption adelay_options[] = {
     { "delays", "set list of delays for each channel", OFFSET(delays), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
+    { "all",    "use last available delay for remained channels", OFFSET(all), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
     { NULL }
 };
 
@@ -163,6 +165,11 @@ static int config_input(AVFilterLink *inlink)
         }
     }
 
+    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;
     for (i = 1; i < s->nb_delays; i++) {
         ChanDelay *d = &s->chandelay[i];