avfilter/avf_showspectrum: unbreak dB legend
authorPaul B Mahol <onemda@gmail.com>
Wed, 17 Aug 2016 19:55:23 +0000 (21:55 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 17 Aug 2016 20:02:29 +0000 (22:02 +0200)
libavfilter/avf_showspectrum.c

index 567ce5d..5741a1e 100644 (file)
@@ -1233,9 +1233,13 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
                     for (chn = 0; chn < (s->mode == SEPARATE ? 1 : s->nb_display_channels); chn++) {
                         float yf, uf, vf;
                         int channel = (multi) ? s->nb_display_channels - ch - 1 : chn;
+                        float lout[3];
 
                         color_range(s, channel, &yf, &uf, &vf);
-                        pick_color(s, yf, uf, vf, y / (float)h, out);
+                        pick_color(s, yf, uf, vf, y / (float)h, lout);
+                        out[0] += lout[0];
+                        out[1] += lout[1];
+                        out[2] += lout[2];
                     }
                     memset(s->outpicref->data[0]+(s->start_y + h * (ch + 1) - y - 1) * s->outpicref->linesize[0] + s->w + s->start_x + 20, av_clip_uint8(out[0]), 10);
                     memset(s->outpicref->data[1]+(s->start_y + h * (ch + 1) - y - 1) * s->outpicref->linesize[1] + s->w + s->start_x + 20, av_clip_uint8(out[1]), 10);