aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPavel Koshevoy <pkoshevoy@gmail.com>2017-02-20 10:51:28 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-02-20 10:51:28 +0800
commit947fdad92de8ce6912ed8f3095c218c35d0b9fa7 (patch)
tree24e2c09889ea511531bff32beccf7c647a648561 /libavfilter
parentb7d9b4a1f1fcd01084ccbec6f7ef32c853681833 (diff)
downloadffmpeg-947fdad92de8ce6912ed8f3095c218c35d0b9fa7.tar.gz
avfilter/af_atempo: fix drift calculation, ticket #6157
ticket #6157 Reported-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_atempo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index a4878820db..eb626564cd 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);