|
|
|
@ -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) { |
|
|
|
|
for (int j = i + 1; j < s->nb_delays; j++) |
|
|
|
|
s->chandelay[j].delay = s->chandelay[i].delay; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
s->padding = s->chandelay[0].delay; |
|
|
|
|
for (i = 1; i < s->nb_delays; i++) { |
|
|
|
|
ChanDelay *d = &s->chandelay[i]; |
|
|
|
|