Commit 174938e9 authored by David Reid's avatar David Reid

Fix a bug in the enumeration example.

parent 075e5dfa
......@@ -15,9 +15,10 @@ int main(int argc, char** argv)
}
mal_device_info infos[32];
mal_uint32 infoCount = sizeof(infos) / sizeof(infos[0]);
mal_uint32 infoCount;
// Playback devices.
infoCount = sizeof(infos) / sizeof(infos[0]);
mal_result result = mal_enumerate_devices(&context, mal_device_type_playback, &infoCount, infos);
if (result != MAL_SUCCESS) {
printf("Failed to enumerate playback devices.");
......@@ -35,6 +36,7 @@ int main(int argc, char** argv)
// Capture devices.
infoCount = sizeof(infos) / sizeof(infos[0]);
result = mal_enumerate_devices(&context, mal_device_type_capture, &infoCount, infos);
if (result != MAL_SUCCESS) {
printf("Failed to enumerate capture devices.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment