aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-26 06:14:11 -0700
committerChris Robinson <[email protected]>2017-06-26 06:14:11 -0700
commit5d5eff7502a41fbb8b2dbe27239ec860770fe1bb (patch)
tree6cf797c1b601175d4851b81325348f43bfd61388 /Alc/backends/mmdevapi.c
parent4b7cbb50ab0bff14f697afb2e76b9aa3c15892d2 (diff)
Ensure the mmdevapi capture buffer is at least 100ms
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index 75370489..860515be 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -1602,6 +1602,10 @@ static HRESULT ALCmmdevCapture_resetProxy(ALCmmdevCapture *self)
buf_time = ((REFERENCE_TIME)device->UpdateSize*device->NumUpdates*10000000 +
device->Frequency-1) / device->Frequency;
+ // Make sure buffer is at least 100ms in size
+ buf_time = maxu64(buf_time, U64(1000000));
+ device->UpdateSize = (buf_time*device->Frequency + 10000000-1)/10000000 /
+ device->NumUpdates;
OutputType.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
switch(device->FmtChans)