diff options
-rw-r--r-- | Alc/backends/winmm.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index ee2c3a34..6ca5f31d 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -513,16 +513,39 @@ static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) if(i == NumCaptureDevices) return ALC_INVALID_VALUE; + switch(pDevice->FmtChans) + { + case DevFmtMono: + case DevFmtStereo: + break; + + case DevFmtQuad: + case DevFmtX51: + case DevFmtX51Side: + case DevFmtX61: + case DevFmtX71: + return ALC_INVALID_ENUM; + } + + switch(pDevice->FmtType) + { + case DevFmtUByte: + case DevFmtShort: + case DevFmtInt: + case DevFmtFloat: + break; + + case DevFmtByte: + case DevFmtUShort: + case DevFmtUInt: + return ALC_INVALID_ENUM; + } + pData = calloc(1, sizeof(*pData)); if(!pData) return ALC_OUT_OF_MEMORY; pDevice->ExtraData = pData; - if((pDevice->FmtChans != DevFmtMono && pDevice->FmtChans != DevFmtStereo) || - (pDevice->FmtType != DevFmtUByte && pDevice->FmtType != DevFmtShort && - pDevice->FmtType != DevFmtInt && pDevice->FmtType != DevFmtFloat)) - goto failure; - memset(&wfexCaptureFormat, 0, sizeof(WAVEFORMATEX)); wfexCaptureFormat.wFormatTag = ((pDevice->FmtType == DevFmtFloat) ? WAVE_FORMAT_IEEE_FLOAT : WAVE_FORMAT_PCM); |