mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
API CHANGE: Move pUserData from device_init() to device_config_init().
This change makes it consistent with mal_pcm_converter, mal_src, etc.
This commit is contained in:
@@ -52,12 +52,12 @@ mal_uint32 on_send_to_device__dithered(mal_device* pDevice, mal_uint32 frameCoun
|
||||
|
||||
int do_dithering_test()
|
||||
{
|
||||
mal_device_config config = mal_device_config_init_playback(mal_format_f32, 1, 0, on_send_to_device__original);
|
||||
mal_device_config config = mal_device_config_init_playback(mal_format_f32, 1, 0, on_send_to_device__original, NULL);
|
||||
mal_device device;
|
||||
mal_result result;
|
||||
|
||||
// We first play the sound the way it's meant to be played.
|
||||
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, NULL, &device);
|
||||
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, &device);
|
||||
if (result != MAL_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
@@ -102,9 +102,9 @@ int do_dithering_test()
|
||||
return -3;
|
||||
}
|
||||
|
||||
config = mal_device_config_init_playback(converterOutConfig.formatOut, 1, 0, on_send_to_device__dithered);
|
||||
config = mal_device_config_init_playback(converterOutConfig.formatOut, 1, 0, on_send_to_device__dithered, &converterOut);
|
||||
|
||||
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, &converterOut, &device);
|
||||
result = mal_device_init(NULL, mal_device_type_playback, NULL, &config, &device);
|
||||
if (result != MAL_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
+2
-2
@@ -2289,14 +2289,14 @@ 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_playback(on_send__playback_test);
|
||||
mal_device_config deviceConfig = mal_device_config_init_default_playback(on_send__playback_test, &callbackData);
|
||||
deviceConfig.onStopCallback = 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, &callbackData, &device);
|
||||
result = mal_device_init_ex(&backend, 1, &contextConfig, mal_device_type_playback, NULL, &deviceConfig, &device);
|
||||
if (result == MAL_SUCCESS) {
|
||||
printf("Done\n");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user