diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-10-14 02:19:29 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-10-14 02:19:29 +0400 |
commit | 9e17ecf0100af4e95f32a7b03673e880a9fc8d1e (patch) | |
tree | 9e01ee9208ba5e5e900b6bf18a5c95cd2f67c4e4 /source/blender/blenkernel/intern/sound.c | |
parent | d893ac690cfe34e922d34a65a1ca526f8297c129 (diff) |
Fixing [#28907] Frozen playback.
Also fixing two more crashes when audio files don't exist/cannot be read and apply a changed file path of a sound, reported by Jens Verwiebe in IRC.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index f2d92154c66..649b4f0b724 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -295,7 +295,10 @@ void sound_cache(struct bSound* sound) AUD_unload(sound->cache); sound->cache = AUD_bufferSound(sound->handle); - sound->playback_handle = sound->cache; + if(sound->cache) + sound->playback_handle = sound->cache; + else + sound->playback_handle = sound->handle; } void sound_cache_notifying(struct Main* main, struct bSound* sound) @@ -332,6 +335,8 @@ void sound_load(struct Main *bmain, struct bSound* sound) sound->playback_handle = NULL; } + sound_free_waveform(sound); + // XXX unused currently #if 0 switch(sound->type) @@ -625,7 +630,7 @@ float sound_sync_scene(struct Scene *scene) else return AUD_getPosition(scene->sound_scene_handle); } - return 0.0f; + return .0f/.0f; } int sound_scene_playing(struct Scene *scene) @@ -782,7 +787,7 @@ static void sound_start_play_scene(struct Scene *UNUSED(scene)) {} void sound_play_scene(struct Scene *UNUSED(scene)) {} void sound_stop_scene(struct Scene *UNUSED(scene)) {} void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {} -float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; } +float sound_sync_scene(struct Scene *UNUSED(scene)) { return .0f/.0f; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } void sound_read_waveform(struct bSound* sound) { (void)sound; } |