Browse Source

avfilter/avf_showwaves: make use of av_rescale_q

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

+ 1
- 1
libavfilter/avf_showwaves.c View File

@@ -416,7 +416,7 @@ static int config_output(AVFilterLink *outlink)
showwaves->n = 1; showwaves->n = 1;


if (!showwaves->n) if (!showwaves->n)
showwaves->n = FFMAX(1, ((double)inlink->sample_rate / (showwaves->w * av_q2d(showwaves->rate))) + 0.5);
showwaves->n = FFMAX(1, av_rescale_q(inlink->sample_rate, av_make_q(1, showwaves->w), showwaves->rate));


showwaves->buf_idx = 0; showwaves->buf_idx = 0;
if (!(showwaves->buf_idy = av_mallocz_array(nb_channels, sizeof(*showwaves->buf_idy)))) { if (!(showwaves->buf_idy = av_mallocz_array(nb_channels, sizeof(*showwaves->buf_idy)))) {


Loading…
Cancel
Save