[Bf-blender-cvs] [35db1195455] master: Sound: Fix access original scene during playback

Sergey Sharybin noreply at git.blender.org
Fri May 3 17:20:51 CEST 2019


Commit: 35db1195455ae38b85cf675754b97edf0d12931c
Author: Sergey Sharybin
Date:   Fri May 3 17:19:24 2019 +0200
Branches: master
https://developer.blender.org/rB35db1195455ae38b85cf675754b97edf0d12931c

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.

===================================================================

M	source/blender/editors/screen/screen_ops.c

===================================================================

diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index e35a2679b8f..ff8946c0320 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -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 */



More information about the Bf-blender-cvs mailing list