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:
authorJörg Müller <nexyon@gmail.com>2017-01-06 20:18:20 +0300
committerJörg Müller <nexyon@gmail.com>2017-01-06 20:18:20 +0300
commite713009e9b83bc7a43443712799c7a24c9dec1cf (patch)
treeb330cd7c8fbee3657d7e3b3df72ea450a02937d6 /source/blender/blenkernel/intern/sound.c
parent62604c5c20f5649b95d6fd371db1e918e2ba2b73 (diff)
Fix: Audio plays back incorrectly after rendering to a video file
D2365
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index d5a395ffc4b..22288127119 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -454,6 +454,16 @@ void BKE_sound_destroy_scene(struct Scene *scene)
AUD_destroySet(scene->speaker_handles);
}
+void BKE_sound_reset_scene_specs(struct Scene *scene)
+{
+ AUD_Specs specs;
+
+ specs.channels = AUD_Device_getChannels(sound_device);
+ specs.rate = AUD_Device_getRate(sound_device);
+
+ AUD_Sequence_setSpecs(scene->sound_scene, specs);
+}
+
void BKE_sound_mute_scene(struct Scene *scene, int muted)
{
if (scene->sound_scene)
@@ -580,15 +590,10 @@ void BKE_sound_update_sequencer(struct Main *main, bSound *sound)
static void sound_start_play_scene(struct Scene *scene)
{
- AUD_Specs specs;
-
if (scene->playback_handle)
AUD_Handle_stop(scene->playback_handle);
- specs.channels = AUD_Device_getChannels(sound_device);
- specs.rate = AUD_Device_getRate(sound_device);
-
- AUD_Sequence_setSpecs(scene->sound_scene, specs);
+ BKE_sound_reset_scene_specs(scene);
if ((scene->playback_handle = AUD_Device_play(sound_device, scene->sound_scene, 1)))
AUD_Handle_setLoopCount(scene->playback_handle, -1);
@@ -910,6 +915,7 @@ void BKE_sound_delete_cache(struct bSound *UNUSED(sound)) {}
void BKE_sound_load(struct Main *UNUSED(bmain), struct bSound *UNUSED(sound)) {}
void BKE_sound_create_scene(struct Scene *UNUSED(scene)) {}
void BKE_sound_destroy_scene(struct Scene *UNUSED(scene)) {}
+void BKE_sound_reset_scene_specs(struct Scene *UNUSED(scene)) {}
void BKE_sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
void *BKE_sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence),
int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }