summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-05-28 10:49:09 +0200
committerPaul B Mahol <onemda@gmail.com>2019-05-28 10:49:09 +0200
commitd2e76a1f96d74ea9315ad09bfe018d5fe64ec68c (patch)
tree85c041db946193faa2174f3f78e9ca238d1299dc /libavfilter
parent618f8bb0a49eba78e6b1af65f8129363464c1968 (diff)
avfilter/avf_showvolume: make use of av_rescale
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avf_showvolume.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index 7a8e583556..548d73c14f 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -165,7 +165,7 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
ShowVolumeContext *s = ctx->priv;
- s->nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
s->values = av_calloc(inlink->channels * VAR_VARS_NB, sizeof(double));
if (!s->values)
return AVERROR(ENOMEM);