[Bf-blender-cvs] [9f17300] master: Fix T39607: Audio not in synch when the blend file loads.

Bastien Montagne noreply at git.blender.org
Tue Apr 15 14:27:14 CEST 2014


Commit: 9f17300d378f1905dbeeceb25a49a17fd256f9f2
Author: Bastien Montagne
Date:   Tue Apr 15 14:23:13 2014 +0200
https://developer.blender.org/rB9f17300d378f1905dbeeceb25a49a17fd256f9f2

Fix T39607: Audio not in synch when the blend file loads.

Root of issue is probably in AUDASPACE itself (or even in OpenAL?).
Issue not present with SDL backend, only OpenAL afaik.

For now, workaround in Blender is to call seek twice when starting play
(not needed when resuming from pause).

===================================================================

M	source/blender/blenkernel/intern/sound.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 5c7b86a..bdd06e9 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -559,12 +559,15 @@ void sound_play_scene(struct Scene *scene)
 
 	status = scene->sound_scene_handle ? AUD_getStatus(scene->sound_scene_handle) : AUD_STATUS_INVALID;
 
-	if (status == AUD_STATUS_INVALID)
+	if (status == AUD_STATUS_INVALID) {
 		sound_start_play_scene(scene);
 
-	if (!scene->sound_scene_handle) {
-		AUD_unlock();
-		return;
+		if (!scene->sound_scene_handle) {
+			AUD_unlock();
+			return;
+		}
+
+		AUD_seek(scene->sound_scene_handle, cur_time);
 	}
 
 	if (status != AUD_STATUS_PLAYING) {




More information about the Bf-blender-cvs mailing list