Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-10 12:57:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-10 12:58:37 +0300
commitd3b42fc167e548655ade53ecaa5c3a11b8ef6a81 (patch)
treefd1074897df083e983c19e81f51ddb80c652f51f
parentf4b963dbddc049313fed9d7e8cfecd5f2a6a9ecf (diff)
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.
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c14
1 files changed, 13 insertions, 1 deletions
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) {