Fix openal channelupdate offset issue.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5586 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
322754174b
commit
7628dcae73
2 changed files with 2 additions and 4 deletions
|
@ -906,9 +906,7 @@ static void OpenAL_ChannelUpdate(soundcardinfo_t *sc, channel_t *chan, chanupdat
|
||||||
{
|
{
|
||||||
if (schanged == CUR_UPDATE && chan->pos)
|
if (schanged == CUR_UPDATE && chan->pos)
|
||||||
{ //complex update, but not restart. pos contains an offset, rather than an absolute time.
|
{ //complex update, but not restart. pos contains an offset, rather than an absolute time.
|
||||||
int cursample;
|
palSourcei(src, AL_SAMPLE_OFFSET, (chan->pos>>PITCHSHIFT));
|
||||||
palGetSourcei(src, AL_SAMPLE_OFFSET, &cursample);
|
|
||||||
palSourcei(src, AL_SAMPLE_OFFSET, cursample + (chan->pos>>PITCHSHIFT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pitch = (float)chan->rate/(1<<PITCHSHIFT);
|
pitch = (float)chan->rate/(1<<PITCHSHIFT);
|
||||||
|
|
|
@ -2878,7 +2878,7 @@ static void S_UpdateSoundCard(soundcardinfo_t *sc, qboolean updateonly, channel_
|
||||||
int vol;
|
int vol;
|
||||||
int ch_idx;
|
int ch_idx;
|
||||||
int skip;
|
int skip;
|
||||||
int absstartpos = updateonly?target_chan->pos:0;
|
int absstartpos = updateonly?sc->GetChannelPos?sc->GetChannelPos(sc, target_chan)<<PITCHSHIFT:target_chan->pos:0;
|
||||||
extern cvar_t cl_demospeed;
|
extern cvar_t cl_demospeed;
|
||||||
chanupdatereason_t chanupdatetype = updateonly?CUR_UPDATE:CUR_EVERYTHING;
|
chanupdatereason_t chanupdatetype = updateonly?CUR_UPDATE:CUR_EVERYTHING;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue