]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_vibrato.c
avfilter: Constify all AVFilters
[ffmpeg] / libavfilter / af_vibrato.c
index 22bbab6239b950c8a9aecc8c4fe0cc403d80f708..fe4d19453180dd5a9a947fc5aa2c8f51eacbb78d 100644 (file)
@@ -162,7 +162,7 @@ static int config_input(AVFilterLink *inlink)
     s->buf = av_calloc(inlink->channels, sizeof(*s->buf));
     if (!s->buf)
         return AVERROR(ENOMEM);
-    s->buf_size = inlink->sample_rate * 0.005;
+    s->buf_size = lrint(inlink->sample_rate * 0.005 + 0.5);
     for (c = 0; c < s->channels; c++) {
         s->buf[c] = av_malloc_array(s->buf_size, sizeof(*s->buf[c]));
         if (!s->buf[c])
@@ -170,7 +170,7 @@ static int config_input(AVFilterLink *inlink)
     }
     s->buf_index = 0;
 
-    s->wave_table_size = inlink->sample_rate / s->freq;
+    s->wave_table_size = lrint(inlink->sample_rate / s->freq + 0.5);
     s->wave_table = av_malloc_array(s->wave_table_size, sizeof(*s->wave_table));
     if (!s->wave_table)
         return AVERROR(ENOMEM);
@@ -198,7 +198,7 @@ static const AVFilterPad avfilter_af_vibrato_outputs[] = {
     { NULL }
 };
 
-AVFilter ff_af_vibrato = {
+const AVFilter ff_af_vibrato = {
     .name          = "vibrato",
     .description   = NULL_IF_CONFIG_SMALL("Apply vibrato effect."),
     .priv_size     = sizeof(VibratoContext),