avfilter/showvolume : indent after prev commit and add comment

pull/283/head
Martin Vignali 7 years ago committed by Paul B Mahol
parent e4cfb2c669
commit 78b6887da3
  1. 7
      libavfilter/avf_showvolume.c

@ -358,13 +358,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return AVERROR(ENOMEM);
av_frame_make_writable(out);
/* draw volume level */
for (c = 0; c < inlink->channels && s->h >= 8 && s->draw_volume; c++) {
char buf[16];
if (s->orientation) {
if (s->orientation) { /* vertical */
snprintf(buf, sizeof(buf), "%.2f", s->values[c * VAR_VARS_NB + VAR_VOLUME]);
drawtext(out, c * (s->h + s->b) + (s->h - 8) / 2, 2, buf, 1);
} else {
} else { /* horizontal */
snprintf(buf, sizeof(buf), "%.2f", s->values[c * VAR_VARS_NB + VAR_VOLUME]);
drawtext(out, FFMAX(0, s->w - 8 * (int)strlen(buf)), c * (s->h + s->b) + (s->h - 8) / 2, buf, 0);
}

Loading…
Cancel
Save