summaryrefslogtreecommitdiff
path: root/libavfilter/avf_showvolume.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-07-03 18:30:27 +0000
committerPaul B Mahol <onemda@gmail.com>2015-07-03 18:43:21 +0000
commite658b1036c0b9e0eedf41eb3b4eae569952ec575 (patch)
tree928dcfc880b5856e4e7d5a68f0cd89fc2a2b1bc6 /libavfilter/avf_showvolume.c
parentc3a5702ebf1a63443efb90a692be94ae3f2f570a (diff)
avfilter/avf_showvolume: make it possible to use current channel number in color expression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/avf_showvolume.c')
-rw-r--r--libavfilter/avf_showvolume.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index 72e18d5d09..19dcc84fc8 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -59,8 +59,8 @@ static const AVOption showvolume_options[] = {
AVFILTER_DEFINE_CLASS(showvolume);
-static const char *const var_names[] = { "VOLUME", NULL };
-enum { VAR_VOLUME, VAR_VARS_NB };
+static const char *const var_names[] = { "VOLUME", "CHANNEL", NULL };
+enum { VAR_VOLUME, VAR_CHANNEL, VAR_VARS_NB };
static av_cold int init(AVFilterContext *ctx)
{
@@ -201,6 +201,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
max = av_clipf(max, 0, 1);
values[VAR_VOLUME] = 20.0 * log(max) / M_LN10;
+ values[VAR_CHANNEL] = c;
color = av_expr_eval(s->c_expr, values, NULL);
for (j = 0; j < s->h; j++) {