]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_adelay.c
avfilter/firequalizer: add scale option
[ffmpeg] / libavfilter / af_adelay.c
index 09bf3c7732f1cb070f20e2369f1cd85454fc08ea..187cacf28afd5ebd0dd7ff8d763aff8714bf045d 100644 (file)
@@ -138,14 +138,20 @@ static int config_input(AVFilterLink *inlink)
     for (i = 0; i < s->nb_delays; i++) {
         ChanDelay *d = &s->chandelay[i];
         float delay;
+        char type = 0;
+        int ret;
 
         if (!(arg = av_strtok(p, "|", &saveptr)))
             break;
 
         p = NULL;
-        sscanf(arg, "%f", &delay);
 
-        d->delay = delay * inlink->sample_rate / 1000.0;
+        ret = sscanf(arg, "%d%c", &d->delay, &type);
+        if (ret != 2 || type != 'S') {
+            sscanf(arg, "%f", &delay);
+            d->delay = delay * inlink->sample_rate / 1000.0;
+        }
+
         if (d->delay < 0) {
             av_log(ctx, AV_LOG_ERROR, "Delay must be non negative number.\n");
             return AVERROR(EINVAL);