From 58b49fdbb93cfa91444671a695c2d8e17d320726 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 19 Nov 2018 20:48:16 +1000 Subject: [PATCH] Potential fix for an initialization error with OpenAL. --- mini_al.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mini_al.h b/mini_al.h index 0147fba0..bb999c6b 100644 --- a/mini_al.h +++ b/mini_al.h @@ -18987,6 +18987,8 @@ mal_result mal_device_init__openal(mal_context* pContext, mal_device_type type, if (type == mal_device_type_playback) { pDeviceALC = ((MAL_LPALCOPENDEVICE)pContext->openal.alcOpenDevice)((pDeviceID == NULL) ? NULL : pDeviceID->openal); } else { + // I had a bug report that suggested I set the OpenAL context to NULL before attempting to open a capture device. + ((MAL_LPALCMAKECONTEXTCURRENT)pContext->openal.alcMakeContextCurrent)(NULL); pDeviceALC = ((MAL_LPALCCAPTUREOPENDEVICE)pContext->openal.alcCaptureOpenDevice)((pDeviceID == NULL) ? NULL : pDeviceID->openal, frequencyAL, formatAL, bufferSizeInSamplesAL); }