]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_compand: "use local variable for channels" from libavfilter/af_compand_fork.c
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 26 Feb 2014 11:50:54 +0000 (12:50 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 26 Feb 2014 12:00:09 +0000 (13:00 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_compand.c

index 6ad4ff3973d2b3de4a725134615ebf4cb9fa6308..10f7f0953e95c002eb275cbb49490defaed7f457 100644 (file)
@@ -344,14 +344,14 @@ static int config_output(AVFilterLink *outlink)
         return AVERROR(EINVAL);
     }
 
-    if ((nb_attacks > outlink->channels) || (nb_decays > outlink->channels)) {
+    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);
     }
 
     uninit(ctx);
 
-    s->channels = av_mallocz_array(outlink->channels, sizeof(*s->channels));
+    s->channels = av_mallocz_array(channels, sizeof(*s->channels));
     s->nb_segments = (nb_points + 4) * 2;
     s->segments = av_mallocz_array(s->nb_segments, sizeof(*s->segments));
 
@@ -486,7 +486,7 @@ static int config_output(AVFilterLink *outlink)
     s->in_min_lin  = exp(s->segments[1].x);
     s->out_min_lin = exp(s->segments[1].y);
 
-    for (i = 0; i < outlink->channels; i++) {
+    for (i = 0; i < channels; i++) {
         ChanParam *cp = &s->channels[i];
 
         if (cp->attack > 1.0 / sample_rate)