Fix T72632: Blender crashes using Jack with AV Sync enabled (repeatable)

This commit is contained in:
Joerg Mueller 2020-03-23 09:33:02 +01:00
parent 46c0da6e69
commit 0710fb724b
Notes: blender-bot 2023-02-14 08:39:23 +01:00
Referenced by issue #72632, Blender crashes using Jack with AV Sync enabled (repeatable)
4 changed files with 27 additions and 0 deletions

View File

@ -117,6 +117,9 @@ void BKE_sound_ensure_scene(struct Scene *scene);
void BKE_sound_destroy_scene(struct Scene *scene);
void BKE_sound_lock_scene(struct Scene *scene);
void BKE_sound_unlock_scene(struct Scene *scene);
void BKE_sound_reset_scene_specs(struct Scene *scene);
void BKE_sound_mute_scene(struct Scene *scene, int muted);

View File

@ -550,6 +550,16 @@ void BKE_sound_destroy_scene(Scene *scene)
}
}
void BKE_sound_lock_scene(struct Scene *scene)
{
AUD_Device_lock(sound_device);
}
void BKE_sound_unlock_scene(struct Scene *scene)
{
AUD_Device_unlock(sound_device);
}
void BKE_sound_reset_scene_specs(Scene *scene)
{
sound_verify_evaluated_id(&scene->id);
@ -1151,6 +1161,12 @@ void BKE_sound_create_scene(Scene *UNUSED(scene))
void BKE_sound_destroy_scene(Scene *UNUSED(scene))
{
}
void BKE_sound_lock_scene(Scene *UNUSED(scene))
{
}
void BKE_sound_unlock_scene(Scene *UNUSED(scene))
{
}
void BKE_sound_reset_scene_specs(Scene *UNUSED(scene))
{
}

View File

@ -23,6 +23,8 @@
#include "intern/eval/deg_eval_runtime_backup_scene.h"
#include "BKE_sound.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
@ -44,6 +46,8 @@ void SceneBackup::reset()
void SceneBackup::init_from_scene(Scene *scene)
{
BKE_sound_lock_scene(scene);
sound_scene = scene->sound_scene;
playback_handle = scene->playback_handle;
sound_scrub_handle = scene->sound_scrub_handle;
@ -76,6 +80,8 @@ void SceneBackup::restore_to_scene(Scene *scene)
sequencer_backup.restore_to_scene(scene);
BKE_sound_unlock_scene(scene);
reset();
}

View File

@ -217,8 +217,10 @@ static void sound_jack_sync_callback(Main *bmain, int mode, float time)
if (depsgraph == NULL) {
continue;
}
BKE_sound_lock_scene(scene);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
BKE_sound_jack_scene_update(scene_eval, mode, time);
BKE_sound_unlock_scene(scene);
}
}