From e848abf4df88f82da9a7918a5ad7128b5ed1aa4e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 7 May 2017 13:00:06 +0300 Subject: [PATCH] Fixed restoration of absolute time position for sounds Loading of saved game no longer restarts sounds from beginning --- src/sound/oalsound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 203ea8955..f323f858a 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -1585,7 +1585,7 @@ FISoundChannel *OpenALSoundRenderer::StartSound(SoundHandle sfx, float vol, int else { if((chanflags&SNDF_ABSTIME)) - alSourcef(source, AL_SEC_OFFSET, reuse_chan->StartTime.Lo/1000.f); + alSourcef(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo); else { float offset = std::chrono::duration_cast>( @@ -1793,7 +1793,7 @@ FISoundChannel *OpenALSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener else { if((chanflags&SNDF_ABSTIME)) - alSourcef(source, AL_SEC_OFFSET, reuse_chan->StartTime.Lo/1000.f); + alSourcef(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo); else { float offset = std::chrono::duration_cast>(