aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index fae14ff9..0c2e00b0 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -223,6 +223,9 @@ static HRESULT DoReset(ALCdevice *device)
CoTaskMemFree(wfx);
wfx = NULL;
+ buf_time = ((REFERENCE_TIME)device->UpdateSize*device->NumUpdates*10000000 +
+ device->Frequency-1) / device->Frequency;
+
if(!(device->Flags&DEVICE_FREQUENCY_REQUEST))
device->Frequency = OutputType.Format.nSamplesPerSec;
if(!(device->Flags&DEVICE_CHANNELS_REQUEST))
@@ -391,8 +394,6 @@ static HRESULT DoReset(ALCdevice *device)
SetDefaultWFXChannelOrder(device);
- buf_time = ((REFERENCE_TIME)device->UpdateSize*device->NumUpdates*10000000 +
- device->Frequency-1) / device->Frequency;
hr = IAudioClient_Initialize(data->client, AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
buf_time, 0, &OutputType.Format, NULL);