From 6e6823d9e4ceb94c9f19ef3f9e8e865d05297690 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 31 Aug 2023 18:30:04 +1000 Subject: [PATCH] Update deviceio test. --- tests/test_deviceio/ma_test_deviceio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_deviceio/ma_test_deviceio.c b/tests/test_deviceio/ma_test_deviceio.c index 4330df99..abf10dff 100644 --- a/tests/test_deviceio/ma_test_deviceio.c +++ b/tests/test_deviceio/ma_test_deviceio.c @@ -344,13 +344,15 @@ void on_data(ma_device* pDevice, void* pFramesOut, const void* pFramesIn, ma_uin { case ma_device_type_playback: { - /* In the playback case we just read from our input source. */ + /* + In the playback case we just read from our input source. We're going to use ma_data_source_read_pcm_frames() for this + to ensure the data source abstraction is working properly for each type. */ if (g_State.sourceType == source_type_decoder) { - ma_decoder_read_pcm_frames(&g_State.decoder, pFramesOut, frameCount, NULL); + ma_data_source_read_pcm_frames(&g_State.decoder, pFramesOut, frameCount, NULL); } else if (g_State.sourceType == source_type_waveform) { - ma_waveform_read_pcm_frames(&g_State.waveform, pFramesOut, frameCount, NULL); + ma_data_source_read_pcm_frames(&g_State.waveform, pFramesOut, frameCount, NULL); } else if (g_State.sourceType == source_type_noise) { - ma_noise_read_pcm_frames(&g_State.noise, pFramesOut, frameCount, NULL); + ma_data_source_read_pcm_frames(&g_State.noise, pFramesOut, frameCount, NULL); } } break;