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:
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 3a8754e8dd2..1fe73a1f692 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -681,7 +681,7 @@ void sound_read_waveform(bSound *sound)
}
}
-void sound_update_scene(struct Scene *scene)
+void sound_update_scene(Main *bmain, struct Scene *scene)
{
Object *ob;
Base *base;
@@ -694,6 +694,11 @@ void sound_update_scene(struct Scene *scene)
void *handle;
float quat[4];
+ /* cheap test to skip looping over all objects (no speakers is a common case) */
+ if (BLI_listbase_is_empty(&bmain->speaker)) {
+ goto skip_speakers;
+ }
+
for (SETLOOPER(scene, sce_it, base)) {
ob = base->object;
if (ob->type == OB_SPEAKER) {
@@ -743,6 +748,9 @@ void sound_update_scene(struct Scene *scene)
}
}
+
+skip_speakers:
+
while ((handle = AUD_getSet(scene->speaker_handles))) {
AUD_removeSequence(scene->sound_scene, handle);
}
@@ -808,7 +816,7 @@ void sound_read_waveform(struct bSound *sound) { (void)sound; }
void sound_init_main(struct Main *bmain) { (void)bmain; }
void sound_set_cfra(int cfra) { (void)cfra; }
void sound_update_sequencer(struct Main *main, struct bSound *sound) { (void)main; (void)sound; }
-void sound_update_scene(struct Scene *scene) { (void)scene; }
+void sound_update_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) { }
void sound_update_scene_sound(void *handle, struct bSound *sound) { (void)handle; (void)sound; }
void sound_update_scene_listener(struct Scene *scene) { (void)scene; }
void sound_update_fps(struct Scene *scene) { (void)scene; }