From 495aff71ca81c77d2384dd13f5d24039ab2f9458 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 17 Jun 2019 16:32:29 +0200 Subject: [PATCH] Fix frame jump with AV-sync enabled It was possible to have animation player step happening after manual jump prior to the dependency graph evaluation. Now we forbid changing scene frame if it was manually requested to be changed. --- source/blender/editors/screen/screen_ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e9f3a3fc12a..f6034a7051e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4230,8 +4230,12 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv sync = (scene->flag & SCE_FRAME_DROP); } - if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false && - isfinite(time = BKE_sound_sync_scene(scene_eval))) { + if (scene_eval->id.recalc & ID_RECALC_AUDIO_SEEK) { + /* Ignore seek here, the audio will be updated to the scene frame after jump during next + * dependency graph update. */ + } + else if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false && + isfinite(time = BKE_sound_sync_scene(scene_eval))) { double newfra = (double)time * FPS; /* give some space here to avoid jumps */