Commit 25b22666 authored by Martin Vignali's avatar Martin Vignali Committed by Paul B Mahol

avfilter/showvolume : calculate fade only if fade < 1.

parent 34304677
...@@ -273,6 +273,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) ...@@ -273,6 +273,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
} }
s->out->pts = insamples->pts; s->out->pts = insamples->pts;
if (s->f < 1.) {
for (j = 0; j < outlink->h; j++) { for (j = 0; j < outlink->h; j++) {
uint8_t *dst = s->out->data[0] + j * s->out->linesize[0]; uint8_t *dst = s->out->data[0] + j * s->out->linesize[0];
const uint32_t alpha = s->bgopacity * 255; const uint32_t alpha = s->bgopacity * 255;
...@@ -284,6 +285,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) ...@@ -284,6 +285,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
dst[k * 4 + 3] = FFMAX(dst[k * 4 + 3] * s->f, alpha); dst[k * 4 + 3] = FFMAX(dst[k * 4 + 3] * s->f, alpha);
} }
} }
}
if (s->orientation) { /* vertical */ if (s->orientation) { /* vertical */
for (c = 0; c < inlink->channels; c++) { for (c = 0; c < inlink->channels; c++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment