[FFmpeg-cvslog] avfilter/af_atempo: fix drift calculation, ticket #6157

Pavel Koshevoy git at videolan.org
Mon Feb 20 04:52:02 EET 2017


ffmpeg | branch: master | Pavel Koshevoy <pkoshevoy at gmail.com> | Mon Feb 20 10:51:28 2017 +0800| [947fdad92de8ce6912ed8f3095c218c35d0b9fa7] | committer: Steven Liu

avfilter/af_atempo: fix drift calculation, ticket #6157

ticket #6157

Reported-by: Steven Liu <lq at chinaffmpeg.org>
Signed-off-by: Pavel Koshevoy <pkoshevoy at gmail.com>

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

 libavfilter/af_atempo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index a487882..eb62656 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -697,11 +697,11 @@ static int yae_adjust_position(ATempoContext *atempo)
     AudioFragment       *frag = yae_curr_frag(atempo);
 
     const double prev_output_position =
-        (double)(prev->position[1] - atempo->origin[1] + atempo->window / 2);
+        (double)(prev->position[1] - atempo->origin[1] + atempo->window / 2) *
+        atempo->tempo;
 
     const double ideal_output_position =
-        (double)(prev->position[0] - atempo->origin[0] + atempo->window / 2) /
-        atempo->tempo;
+        (double)(prev->position[0] - atempo->origin[0] + atempo->window / 2);
 
     const int drift = (int)(prev_output_position - ideal_output_position);
 



More information about the ffmpeg-cvslog mailing list