validate the state of the audio device, and attempt to reinit if its not running (and die in a panic if it can't be reinited);

pull/69/head
Bryan Biedenkapp 1 year ago
parent 92070b77db
commit d8efc3e29d

@ -487,6 +487,25 @@ int HostBridge::run()
ms = stopWatch.elapsed();
stopWatch.start();
// ------------------------------------------------------
// -- Audio Device Checking --
// ------------------------------------------------------
if (m_localAudio) {
ma_device_state state = ma_device_get_state(&m_maDevice);
if (state != ma_device_state_started) {
LogError(LOG_HOST, "audio device state invalid, state = %u", state);
// restart audio device
result = ma_device_start(&m_maDevice);
if (result != MA_SUCCESS) {
ma_device_uninit(&m_maDevice);
ma_context_uninit(&m_maContext);
::fatal("failed to reinitialize audio device! panic.");
}
}
}
// ------------------------------------------------------
// -- Network Clocking --
// ------------------------------------------------------

Loading…
Cancel
Save

Powered by TurnKey Linux.