From 618f8bb0a49eba78e6b1af65f8129363464c1968 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 28 May 2019 10:46:38 +0200 Subject: [PATCH] avfilter/avf_abitscope: make use of av_rescale --- libavfilter/avf_abitscope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avf_abitscope.c b/libavfilter/avf_abitscope.c index 221ca566a9..6a38521b6c 100644 --- a/libavfilter/avf_abitscope.c +++ b/libavfilter/avf_abitscope.c @@ -96,7 +96,7 @@ static int config_input(AVFilterLink *inlink) int ch; char *colors, *saveptr = NULL; - s->nb_samples = FFMAX(1, ((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->nb_channels = inlink->channels; s->depth = inlink->format == AV_SAMPLE_FMT_S16P ? 16 : 32;