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.
This commit is contained in:
parent
1bcddea00e
commit
7b311c07ee
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue