Browse Source

avfilter/avf_showvolume: make use of av_rescale

tags/n4.2
Paul B Mahol 6 years ago
parent
commit
d2e76a1f96
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavfilter/avf_showvolume.c

+ 1
- 1
libavfilter/avf_showvolume.c View File

@@ -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);


Loading…
Cancel
Save