Commit 947fdad9 authored by Pavel Koshevoy's avatar Pavel Koshevoy Committed by Steven Liu

avfilter/af_atempo: fix drift calculation, ticket #6157

ticket #6157
Reported-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
Signed-off-by: 's avatarPavel Koshevoy <pkoshevoy@gmail.com>
parent b7d9b4a1
...@@ -697,11 +697,11 @@ static int yae_adjust_position(ATempoContext *atempo) ...@@ -697,11 +697,11 @@ static int yae_adjust_position(ATempoContext *atempo)
AudioFragment *frag = yae_curr_frag(atempo); AudioFragment *frag = yae_curr_frag(atempo);
const double prev_output_position = 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 = const double ideal_output_position =
(double)(prev->position[0] - atempo->origin[0] + atempo->window / 2) / (double)(prev->position[0] - atempo->origin[0] + atempo->window / 2);
atempo->tempo;
const int drift = (int)(prev_output_position - ideal_output_position); const int drift = (int)(prev_output_position - ideal_output_position);
......
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