From 7628dcae738db86f42bf8def9e994fc812dab6cd Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 25 Nov 2019 04:20:56 +0000 Subject: [PATCH] Fix openal channelupdate offset issue. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5586 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/snd_al.c | 4 +--- engine/client/snd_dma.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/client/snd_al.c b/engine/client/snd_al.c index 5e266d5f4..da9a71d08 100644 --- a/engine/client/snd_al.c +++ b/engine/client/snd_al.c @@ -906,9 +906,7 @@ static void OpenAL_ChannelUpdate(soundcardinfo_t *sc, channel_t *chan, chanupdat { if (schanged == CUR_UPDATE && chan->pos) { //complex update, but not restart. pos contains an offset, rather than an absolute time. - int cursample; - palGetSourcei(src, AL_SAMPLE_OFFSET, &cursample); - palSourcei(src, AL_SAMPLE_OFFSET, cursample + (chan->pos>>PITCHSHIFT)); + palSourcei(src, AL_SAMPLE_OFFSET, (chan->pos>>PITCHSHIFT)); } pitch = (float)chan->rate/(1<pos:0; + int absstartpos = updateonly?sc->GetChannelPos?sc->GetChannelPos(sc, target_chan)<pos:0; extern cvar_t cl_demospeed; chanupdatereason_t chanupdatetype = updateonly?CUR_UPDATE:CUR_EVERYTHING;