Commit 62c8707e authored by Paul B Mahol's avatar Paul B Mahol

avfilter/avf_showwaves: make use of av_rescale_q

parent cd753968
......@@ -416,7 +416,7 @@ static int config_output(AVFilterLink *outlink)
showwaves->n = 1;
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;
if (!(showwaves->buf_idy = av_mallocz_array(nb_channels, sizeof(*showwaves->buf_idy)))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment