aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-07-26 11:45:20 -0700
committerChris Robinson <[email protected]>2016-07-26 12:02:03 -0700
commit5e11a738c6b18a367070450ec46dfb714fe433d7 (patch)
treebb298e6d200b486067c34c7496f6c638169f2a8e /Alc/backends/mmdevapi.c
parentd2eb866abeb699394a35610b4764c8e42acc71b5 (diff)
Combine VECTOR_RESIZE and VECTOR_RESERVE
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index f102e385..60d3be00 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -79,7 +79,7 @@ static void clear_devlist(vector_DevMap *list)
(i)->devid = NULL; \
} while(0)
VECTOR_FOR_EACH(DevMap, *list, CLEAR_DEVMAP);
- VECTOR_RESIZE(*list, 0);
+ VECTOR_RESIZE(*list, 0, 0);
#undef CLEAR_DEVMAP
}
@@ -258,11 +258,7 @@ static HRESULT probe_devices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, ve
if(SUCCEEDED(hr) && count > 0)
{
clear_devlist(list);
- if(!VECTOR_RESERVE(*list, count))
- {
- IMMDeviceCollection_Release(coll);
- return E_OUTOFMEMORY;
- }
+ VECTOR_RESIZE(*list, 0, count);
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(devenum, flowdir,
eMultimedia, &defdev);