From bbc679a5db2e000c8638295d58ce97df2695b6c5 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 18 Feb 2012 13:08:54 -0800 Subject: Minor MMDevApi cleanups --- Alc/backends/mmdevapi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index 9eb5cfc5..c4679f85 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -210,9 +210,9 @@ static DevMap *ProbeDevices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, ALu { IMMDeviceCollection *coll; IMMDevice *defdev = NULL; - DevMap *devlist; - UINT count; + DevMap *devlist = NULL; HRESULT hr; + UINT count; UINT idx; UINT i; @@ -337,7 +337,7 @@ static ALCboolean MakeExtensible(WAVEFORMATEXTENSIBLE *out, const WAVEFORMATEX * { memset(out, 0, sizeof(*out)); if(in->wFormatTag == WAVE_FORMAT_EXTENSIBLE) - *out = *(WAVEFORMATEXTENSIBLE*)in; + *out = *(const WAVEFORMATEXTENSIBLE*)in; else if(in->wFormatTag == WAVE_FORMAT_PCM) { out->Format = *in; @@ -982,7 +982,7 @@ void alcMMDevApiDeinit(void) void alcMMDevApiProbe(enum DevProbe type) { - ThreadRequest req; + ThreadRequest req = { NULL, 0 }; HRESULT hr = E_FAIL; switch(type) @@ -1006,11 +1006,12 @@ void alcMMDevApiProbe(enum DevProbe type) AppendAllDeviceList(PlaybackDeviceList[i].name); } } - if(req.FinishedEvt != NULL) - CloseHandle(req.FinishedEvt); break; case CAPTURE_DEVICE_PROBE: break; } + if(req.FinishedEvt != NULL) + CloseHandle(req.FinishedEvt); + req.FinishedEvt = NULL; } -- cgit v1.2.3