mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-26 10:14:04 +02:00
API CHANGE: Remove the device type and ID from mal_device_init/_ex().
This commit is contained in:
+8
-3
@@ -2254,6 +2254,8 @@ void on_send__playback_test(mal_device* pDevice, void* pOutput, const void* pInp
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
(void)pInput;
|
||||
}
|
||||
|
||||
void on_stop__playback_test(mal_device* pDevice)
|
||||
@@ -2284,14 +2286,17 @@ int do_playback_test(mal_backend backend)
|
||||
printf(" Opening Device... ");
|
||||
{
|
||||
mal_context_config contextConfig = mal_context_config_init(on_log);
|
||||
mal_device_config deviceConfig = mal_device_config_init_default(on_send__playback_test, &callbackData);
|
||||
deviceConfig.onStopCallback = on_stop__playback_test;
|
||||
mal_device_config deviceConfig = mal_device_config_init(mal_device_type_playback);
|
||||
deviceConfig.pUserData = &callbackData;
|
||||
deviceConfig.dataCallback = on_send__playback_test;
|
||||
deviceConfig.stopCallback = on_stop__playback_test;
|
||||
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
deviceConfig.format = mal_format_f32;
|
||||
#endif
|
||||
|
||||
result = mal_device_init_ex(&backend, 1, &contextConfig, mal_device_type_playback, NULL, &deviceConfig, &device);
|
||||
result = mal_device_init_ex(&backend, 1, &contextConfig, &deviceConfig, &device);
|
||||
if (result == MAL_SUCCESS) {
|
||||
printf("Done\n");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user