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-06-04 17:52:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-05 15:23:54 +0300
commitbbaa1bffe9dbc35d2791b83d0014ccb4ffb6087a (patch)
treed0ded24e2fb254943831cacca7c28b7752e57eae /source/blender/blenloader
parent863b7b3668fe67a082439181eaf49c3e94a87536 (diff)
Sound: Port to a copy-on-write concept
This change makes it so sound handles are created for evaluated scene, sequencer and speakers. This allows to have properly evaluated animation on them. For the viewport playback sound uses regular dependency graph. For the final render sound uses dependency graph created for render pipeline, which now also contains sequencer and sound datablocks. All the direct sound update calls are replaced with corresponding dependency graph recalc tag.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 32f0d35cd53..a4bdf02c838 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6462,9 +6462,7 @@ static void lib_link_scene(FileData *fd, Main *main)
seq->scene_sound = NULL;
if (seq->scene) {
seq->scene = newlibadr(fd, sce->id.lib, seq->scene);
- if (seq->scene) {
- seq->scene_sound = BKE_sound_scene_add_scene_sound_defaults(sce, seq);
- }
+ seq->scene_sound = NULL;
}
if (seq->clip) {
seq->clip = newlibadr_us(fd, sce->id.lib, seq->clip);
@@ -6485,7 +6483,7 @@ static void lib_link_scene(FileData *fd, Main *main)
}
if (seq->sound) {
id_us_plus_no_lib((ID *)seq->sound);
- seq->scene_sound = BKE_sound_add_scene_sound_defaults(sce, seq);
+ seq->scene_sound = NULL;
}
}
if (seq->type == SEQ_TYPE_TEXT) {
@@ -6504,9 +6502,6 @@ static void lib_link_scene(FileData *fd, Main *main)
}
}
- BKE_sequencer_update_muting(sce->ed);
- BKE_sequencer_update_sound_bounds_all(sce);
-
/* rigidbody world relies on it's linked collections */
if (sce->rigidbody_world) {
RigidBodyWorld *rbw = sce->rigidbody_world;
@@ -6685,7 +6680,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
memset(&sce->customdata_mask, 0, sizeof(sce->customdata_mask));
memset(&sce->customdata_mask_modal, 0, sizeof(sce->customdata_mask_modal));
- BKE_sound_create_scene(sce);
+ BKE_sound_reset_scene_runtime(sce);
/* set users to one by default, not in lib-link, this will increase it for compo nodes */
id_us_ensure_real(&sce->id);
@@ -8395,10 +8390,9 @@ static void direct_link_sound(FileData *fd, bSound *sound)
sound->waveform = NULL;
}
- if (sound->spinlock) {
- sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock");
- BLI_spin_init(sound->spinlock);
- }
+ sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock");
+ BLI_spin_init(sound->spinlock);
+
/* clear waveform loading flag */
sound->tags &= ~SOUND_TAGS_WAVEFORM_LOADING;
@@ -8415,7 +8409,7 @@ static void lib_link_sound(FileData *fd, Main *main)
sound->ipo = newlibadr_us(
fd, sound->id.lib, sound->ipo); // XXX deprecated - old animation system
- BKE_sound_load(main, sound);
+ BKE_sound_reset_runtime(sound);
sound->id.tag &= ~LIB_TAG_NEED_LINK;
}