API CHANGE: Remove the device type and ID from mal_device_init/_ex().

This commit is contained in:
David Reid
2019-01-13 09:31:08 +10:00
parent 661115f130
commit 24167ba3c2
5 changed files with 125 additions and 116 deletions
+12 -4
View File
@@ -56,12 +56,18 @@ void on_send_to_device__dithered(mal_device* pDevice, void* pOutput, const void*
int do_dithering_test()
{
mal_device_config config = mal_device_config_init(mal_format_f32, 1, 0, on_send_to_device__original, NULL);
mal_device_config config;
mal_device device;
mal_result result;
config = mal_device_config_init(mal_device_type_playback);
config.format = mal_format_f32;
config.channels = 1;
config.sampleRate = 0;
config.dataCallback = on_send_to_device__original;
// We first play the sound the way it's meant to be played.
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, &device);
result = mal_device_init(NULL, &config, &device);
if (result != MAL_SUCCESS) {
return -1;
}
@@ -106,9 +112,11 @@ int do_dithering_test()
return -3;
}
config = mal_device_config_init(converterOutConfig.formatOut, 1, 0, on_send_to_device__dithered, &converterOut);
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, &device);
config.dataCallback = on_send_to_device__dithered;
config.pUserData = &converterOut;
result = mal_device_init(NULL, &config, &device);
if (result != MAL_SUCCESS) {
return -1;
}