diff options
author | Chris Robinson <[email protected]> | 2014-08-29 19:34:20 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-08-29 19:34:20 -0700 |
commit | f04b15692e3355a80af1d0985c1e9d5e588b670b (patch) | |
tree | 2c826f274cd8267501815b4000fa9c39993d0101 /Alc | |
parent | f18d2f244554a7369bb6989721430ef2c7f0c90d (diff) |
Setup the HRTF format before tracing the pre-reset format
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -1686,8 +1686,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) V0(device->Backend,stop)(); device->Flags = (flags & ~DEVICE_RUNNING); - if(freq != device->Frequency) - UpdateClockBase(device); + UpdateClockBase(device); + device->Frequency = freq; device->FmtChans = schans; device->FmtType = stype; @@ -1748,14 +1748,14 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) ConfigValueUInt(NULL, "sends", &numSends); numSends = minu(MAX_SENDS, numSends); + UpdateClockBase(device); + device->UpdateSize = (ALuint64)device->UpdateSize * freq / device->Frequency; /* SSE and Neon do best with the update size being a multiple of 4 */ if((CPUCapFlags&(CPU_CAP_SSE|CPU_CAP_NEON)) != 0) device->UpdateSize = (device->UpdateSize+3)&~3; - if(freq != device->Frequency) - UpdateClockBase(device); device->Frequency = freq; device->NumMonoSources = numMono; device->NumStereoSources = numStereo; @@ -1767,19 +1767,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) UpdateClockBase(device); - oldFreq = device->Frequency; - oldChans = device->FmtChans; - oldType = device->FmtType; - - TRACE("Pre-reset: %s%s, %s%s, %s%uhz, %u update size x%d\n", - (device->Flags&DEVICE_CHANNELS_REQUEST)?"*":"", - DevFmtChannelsString(device->FmtChans), - (device->Flags&DEVICE_SAMPLE_TYPE_REQUEST)?"*":"", - DevFmtTypeString(device->FmtType), - (device->Flags&DEVICE_FREQUENCY_REQUEST)?"*":"", - device->Frequency, - device->UpdateSize, device->NumUpdates); - if(device->Type != Loopback) { bool usehrtf = !!(device->Flags&DEVICE_HRTF_REQUEST); @@ -1810,6 +1797,19 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) } } + oldFreq = device->Frequency; + oldChans = device->FmtChans; + oldType = device->FmtType; + + TRACE("Pre-reset: %s%s, %s%s, %s%uhz, %u update size x%d\n", + (device->Flags&DEVICE_CHANNELS_REQUEST)?"*":"", + DevFmtChannelsString(device->FmtChans), + (device->Flags&DEVICE_SAMPLE_TYPE_REQUEST)?"*":"", + DevFmtTypeString(device->FmtType), + (device->Flags&DEVICE_FREQUENCY_REQUEST)?"*":"", + device->Frequency, + device->UpdateSize, device->NumUpdates); + if(V0(device->Backend,reset)() == ALC_FALSE) return ALC_INVALID_DEVICE; |