[FFmpeg-cvslog] avfilter/avf_aphasemeter: make use of av_rescale

Paul B Mahol git at videolan.org
Tue May 28 12:17:04 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 28 11:10:51 2019 +0200| [819ed1df94dff335c2653a83e1d3001aa5797f9e] | committer: Paul B Mahol

avfilter/avf_aphasemeter: make use of av_rescale

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=819ed1df94dff335c2653a83e1d3001aa5797f9e
---

 libavfilter/avf_aphasemeter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index ed837059ea..f497bc9969 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -106,7 +106,7 @@ static int config_input(AVFilterLink *inlink)
     int nb_samples;
 
     if (s->do_video) {
-        nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
+        nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
         inlink->partial_buf_size =
         inlink->min_samples =
         inlink->max_samples = nb_samples;



More information about the ffmpeg-cvslog mailing list