From 1475f8d31827872f0e391a632a417d30e18cb509 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 8 Jun 2016 11:26:54 +0200 Subject: [PATCH] RtAudio: proper under/overflow warning fix #5102 (cherry picked from commit 39260f9dca60d9637cf00264d8ae51e027cb1a51) --- drivers/rtaudio/audio_driver_rtaudio.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index 335f4b632f3..b172ef6e098 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -32,8 +32,14 @@ const char* AudioDriverRtAudio::get_name() const { int AudioDriverRtAudio::callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ) { - if (status) - print_line("lost?"); + if (status) { + if (status & RTAUDIO_INPUT_OVERFLOW) { + WARN_PRINT("RtAudio input overflow!"); + } + if (status & RTAUDIO_OUTPUT_UNDERFLOW) { + WARN_PRINT("RtAudio output underflow!"); + } + } int32_t *buffer = (int32_t *) outputBuffer; AudioDriverRtAudio *self = (AudioDriverRtAudio*)userData;