[Bf-blender-cvs] [d3b42fc167e] master: Fix T66626: Crash when using JACK audio device

Sergey Sharybin noreply at git.blender.org
Wed Jul 10 11:58:40 CEST 2019


Commit: d3b42fc167e548655ade53ecaa5c3a11b8ef6a81
Author: Sergey Sharybin
Date:   Wed Jul 10 11:57:13 2019 +0200
Branches: master
https://developer.blender.org/rBd3b42fc167e548655ade53ecaa5c3a11b8ef6a81

Fix T66626: Crash when using JACK audio device

Restore some context overrides which were originally happening in 2.79.

Made it a bit more paranoid, by storing old values and restoring them
afterwards, so the context is not being changed at the end of the function.

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

M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 6ae682e678a..4bda5167f60 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3242,11 +3242,23 @@ void wm_event_do_handlers(bContext *C)
 
           if (((is_playing_sound == 1) && (is_playing_screen == 0)) ||
               ((is_playing_sound == 0) && (is_playing_screen == 1))) {
+            wmWindow *context_old_win = CTX_wm_window(C);
+            bScreen *context_screen_win = CTX_wm_screen(C);
+            Scene *context_scene_win = CTX_data_scene(C);
+
+            CTX_wm_window_set(C, win);
+            CTX_wm_screen_set(C, screen);
+            CTX_data_scene_set(C, scene);
+
             ED_screen_animation_play(C, -1, 1);
+
+            CTX_data_scene_set(C, context_scene_win);
+            CTX_wm_screen_set(C, context_screen_win);
+            CTX_wm_window_set(C, context_old_win);
           }
 
           if (is_playing_sound == 0) {
-            const float time = BKE_sound_sync_scene(scene);
+            const float time = BKE_sound_sync_scene(scene_eval);
             if (isfinite(time)) {
               int ncfra = time * (float)FPS + 0.5f;
               if (ncfra != scene->r.cfra) {



More information about the Bf-blender-cvs mailing list