aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/winmm.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-01-17 12:21:52 -0800
committerChris Robinson <[email protected]>2012-01-17 12:21:52 -0800
commita7266442c2675df1016e44bbb39b296d179d707f (patch)
treebf23dd290429299075f0eaf55a344b9820899e6c /Alc/backends/winmm.c
parentcf34b9c04e05b6a0b44e7d7cfbf31bcc865b342d (diff)
Retry opening the WinMM device with 16-bit short if 32-bit float output fails
Diffstat (limited to 'Alc/backends/winmm.c')
-rw-r--r--Alc/backends/winmm.c6
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;
}