[Bf-blender-cvs] [b5d527f] master: Fix T49656: Crash when starting playback while using JACK audio with A/V sync

Jörg Müller noreply at git.blender.org
Sat Oct 22 15:01:04 CEST 2016


Commit: b5d527ff6c7e01b73c14d8e01b7e33a697d30b12
Author: Jörg Müller
Date:   Sat Oct 22 15:00:32 2016 +0200
Branches: master
https://developer.blender.org/rBb5d527ff6c7e01b73c14d8e01b7e33a697d30b12

Fix T49656: Crash when starting playback while using JACK audio with A/V sync

When ED_screen_animation_play is called from wm_event_do_handlers,ScrArea *sa = CTX_wm_area(C); is NULL in ED_screen_animation_timer.
Informing the audio system in CTX_data_main_set, that a new Main has been set.

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

M	build_files/cmake/Modules/FindJack.cmake
M	source/blender/blenkernel/intern/context.c
M	source/blender/editors/screen/screen_edit.c

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

diff --git a/build_files/cmake/Modules/FindJack.cmake b/build_files/cmake/Modules/FindJack.cmake
index 59aa7fc..caafa3c 100644
--- a/build_files/cmake/Modules/FindJack.cmake
+++ b/build_files/cmake/Modules/FindJack.cmake
@@ -56,7 +56,7 @@ FIND_LIBRARY(JACK_LIBRARY
 # handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if 
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JACK DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG
     JACK_LIBRARY JACK_INCLUDE_DIR)
 
 IF(JACK_FOUND)
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 926ca8d..4c01bfd 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -49,6 +49,7 @@
 #include "BKE_context.h"
 #include "BKE_main.h"
 #include "BKE_screen.h"
+#include "BKE_sound.h"
 
 #include "RNA_access.h"
 
@@ -882,6 +883,7 @@ Main *CTX_data_main(const bContext *C)
 void CTX_data_main_set(bContext *C, Main *bmain)
 {
 	C->data.main = bmain;
+	BKE_sound_init_main(bmain);
 }
 
 Scene *CTX_data_scene(const bContext *C)
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 677a647..5cd0d33 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -2076,7 +2076,13 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync,
 		sad->flag |= (sync == 0) ? ANIMPLAY_FLAG_NO_SYNC : (sync == 1) ? ANIMPLAY_FLAG_SYNC : 0;
 
 		ScrArea *sa = CTX_wm_area(C);
-		sad->from_anim_edit = (ELEM(sa->spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_TIME));
+
+		char spacetype = -1;
+
+		if (sa)
+			spacetype = sa->spacetype;
+
+		sad->from_anim_edit = (ELEM(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_TIME));
 
 		screen->animtimer->customdata = sad;




More information about the Bf-blender-cvs mailing list