diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/winmm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index c795a70a..8dbe6ef2 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -353,6 +353,7 @@ static ALCenum WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceName) break; } +retry_open: memset(&wfexFormat, 0, sizeof(WAVEFORMATEX)); wfexFormat.wFormatTag = ((pDevice->FmtType == DevFmtFloat) ? WAVE_FORMAT_IEEE_FLOAT : WAVE_FORMAT_PCM); @@ -367,6 +368,11 @@ static ALCenum WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceName) if((res=waveOutOpen(&pData->hWaveHandle.Out, lDeviceID, &wfexFormat, (DWORD_PTR)&WaveOutProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) { + if(pDevice->FmtType == DevFmtFloat) + { + pDevice->FmtType = DevFmtShort; + goto retry_open; + } ERR("waveOutOpen failed: %u\n", res); goto failure; } |