Sound: Fix access original scene during playback

Was required to have AV-sync enabled. and then simply play playback
would have triggered an assert.

In release builds the sync would have happened to a wrong frame.
This commit is contained in:
2019-05-03 17:19:24 +02:00
parent 21f8e75ddb
commit 35db119545

View File

@@ -4289,7 +4289,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
if (screen->animtimer && screen->animtimer == event->customdata) {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
wmTimer *wt = screen->animtimer;
ScreenAnimData *sad = wt->customdata;
wmWindowManager *wm = CTX_wm_manager(C);
@@ -4310,7 +4311,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv
}
if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false &&
isfinite(time = BKE_sound_sync_scene(scene))) {
isfinite(time = BKE_sound_sync_scene(scene_eval))) {
double newfra = (double)time * FPS;
/* give some space here to avoid jumps */