Fix compilation errors with examples.

This commit is contained in:
David Reid
2021-07-31 10:22:20 +10:00
parent d371f3553a
commit 369d3b8df7
4 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -295,7 +295,8 @@ static ma_result ma_context_get_device_info__sdl(ma_context* pContext, ma_device
tempDeviceID = ((MA_PFN_SDL_OpenAudioDevice)pContextEx->sdl.SDL_OpenAudioDevice)(pDeviceName, (deviceType == ma_device_type_playback) ? 0 : 1, &desiredSpec, &obtainedSpec, MA_SDL_AUDIO_ALLOW_ANY_CHANGE);
if (tempDeviceID == 0) {
return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, "Failed to open SDL device.", MA_FAILED_TO_OPEN_BACKEND_DEVICE);
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to open SDL device.");
return MA_FAILED_TO_OPEN_BACKEND_DEVICE;
}
((MA_PFN_SDL_CloseAudioDevice)pContextEx->sdl.SDL_CloseAudioDevice)(tempDeviceID);
@@ -402,7 +403,8 @@ static ma_result ma_device_init_internal__sdl(ma_device_ex* pDeviceEx, const ma_
deviceID = ((MA_PFN_SDL_OpenAudioDevice)pContextEx->sdl.SDL_OpenAudioDevice)(pDeviceName, (pConfig->deviceType == ma_device_type_playback) ? 0 : 1, &desiredSpec, &obtainedSpec, MA_SDL_AUDIO_ALLOW_ANY_CHANGE);
if (deviceID == 0) {
return ma_post_error((ma_device*)pDeviceEx, MA_LOG_LEVEL_ERROR, "Failed to open SDL2 device.", MA_FAILED_TO_OPEN_BACKEND_DEVICE);
ma_log_postf(ma_device_get_log((ma_device*)pDeviceEx), MA_LOG_LEVEL_ERROR, "Failed to open SDL2 device.");
return MA_FAILED_TO_OPEN_BACKEND_DEVICE;
}
if (pConfig->deviceType == ma_device_type_playback) {
@@ -647,7 +649,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
pSineWave = (ma_waveform*)pDevice->pUserData;
MA_ASSERT(pSineWave != NULL);
ma_waveform_read_pcm_frames(pSineWave, pOutput, frameCount);
ma_waveform_read_pcm_frames(pSineWave, pOutput, frameCount, NULL);
}
if (pDevice->type == ma_device_type_duplex) {
+1 -1
View File
@@ -35,7 +35,7 @@ void data_callback_fixed(ma_device* pDevice, void* pOutput, const void* pInput,
*/
printf("frameCount=%d\n", frameCount);
ma_waveform_read_pcm_frames(&g_sineWave, pOutput, frameCount);
ma_waveform_read_pcm_frames(&g_sineWave, pOutput, frameCount, NULL);
/* Unused in this example. */
(void)pDevice;
+1 -1
View File
@@ -19,7 +19,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
ma_encoder* pEncoder = (ma_encoder*)pDevice->pUserData;
MA_ASSERT(pEncoder != NULL);
ma_encoder_write_pcm_frames(pEncoder, pInput, frameCount);
ma_encoder_write_pcm_frames(pEncoder, pInput, frameCount, NULL);
(void)pOutput;
}
+1 -1
View File
@@ -40,7 +40,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
pSineWave = (ma_waveform*)pDevice->pUserData;
MA_ASSERT(pSineWave != NULL);
ma_waveform_read_pcm_frames(pSineWave, pOutput, frameCount);
ma_waveform_read_pcm_frames(pSineWave, pOutput, frameCount, NULL);
(void)pInput; /* Unused. */
}