From ced16e13383a1fbc99fd9ba8f1b67cf61b9e109f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Fri, 27 Dec 2024 15:14:08 +0800 Subject: [PATCH] check for sio errors --- sndlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sndlock.cpp b/sndlock.cpp index fe7ce5b..27db760 100644 --- a/sndlock.cpp +++ b/sndlock.cpp @@ -88,6 +88,12 @@ static void dsp_thread() std::cout << buf_in[i] << " "; std::cout << std::endl; } + + if(sio_eof(hdl)) { + std::cerr << "sound I/O error" << std::endl; + sio_close(hdl); + return; + } } sio_stop(hdl);