summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2018-03-31 15:51:18 +0200
committerPaul B Mahol <onemda@gmail.com>2018-04-01 15:40:05 +0200
commit78b6887da3b926db7df64807ef6f3026136921fc (patch)
tree65e17c9469846dc50fc50c72c86451406c17ac8f /libavfilter
parente4cfb2c669993f01011e940de30e5da11a191b01 (diff)
avfilter/showvolume : indent after prev commit and add comment
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avf_showvolume.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index 4f31cebc7b..7fe3916855 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -358,15 +358,16 @@ 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) {
- 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 {
- 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);
+ 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 { /* 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);
}
}