]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_compand.c
avfilter: Constify all AVFilters
[ffmpeg] / libavfilter / af_compand.c
index c138f0b1d8f97c516348da3f947f2d48c17ced53..62d9c2e941f9a6ba55cc4c75d648550bfbce6939 100644 (file)
@@ -349,9 +349,10 @@ static int config_output(AVFilterLink *outlink)
     }
 
     if (nb_attacks > channels || nb_decays > channels) {
-        av_log(ctx, AV_LOG_ERROR,
-                "Number of attacks/decays bigger than number of channels.\n");
-        return AVERROR(EINVAL);
+        av_log(ctx, AV_LOG_WARNING,
+                "Number of attacks/decays bigger than number of channels. Ignoring rest of entries.\n");
+        nb_attacks = FFMIN(nb_attacks, channels);
+        nb_decays  = FFMIN(nb_decays, channels);
     }
 
     uninit(ctx);
@@ -534,7 +535,7 @@ static int config_output(AVFilterLink *outlink)
     s->delay_frame->nb_samples     = s->delay_samples;
     s->delay_frame->channel_layout = outlink->channel_layout;
 
-    err = av_frame_get_buffer(s->delay_frame, 32);
+    err = av_frame_get_buffer(s->delay_frame, 0);
     if (err)
         return err;
 
@@ -584,7 +585,7 @@ static const AVFilterPad compand_outputs[] = {
 };
 
 
-AVFilter ff_af_compand = {
+const AVFilter ff_af_compand = {
     .name           = "compand",
     .description    = NULL_IF_CONFIG_SMALL(
             "Compress or expand audio dynamic range."),