check sound device parameters

This commit is contained in:
Sébastien Bourdeauducq 2025-01-19 10:08:00 +08:00
parent d54e816ff4
commit 47921d7fe3

View File

@ -75,6 +75,16 @@ static void dsp_thread()
sio_close(hdl); sio_close(hdl);
return; return;
} }
if(par.sig != 1
|| par.bits != SND_BITS
|| par.pchan != SND_PCHAN
|| par.rchan != SND_RCHAN
|| par.rate != SND_RATE
|| par.le != SIO_LE_NATIVE) {
std::cerr << "sound device parameter mismatch" << std::endl;
sio_close(hdl);
return;
}
if(!sio_start(hdl)) { if(!sio_start(hdl)) {
std::cerr << "failed to start sound device" << std::endl; std::cerr << "failed to start sound device" << std::endl;