mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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>
This commit is contained in:
parent
b7d9b4a1f1
commit
947fdad92d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user