dont push to audio buffers if playback device isnt started

This commit is contained in:
ouwou 2023-12-17 01:17:08 -05:00
parent 925864f082
commit 705938a0a8

View File

@ -215,7 +215,7 @@ void AudioManager::SetOpusBuffer(uint8_t *ptr) {
}
void AudioManager::FeedMeOpus(uint32_t ssrc, const std::vector<uint8_t> &data) {
if (!m_should_playback) return;
if (!m_should_playback || ma_device_get_state(&m_playback_device) != ma_device_state_started) return;
std::lock_guard<std::mutex> _(m_mutex);
if (m_muted_ssrcs.find(ssrc) != m_muted_ssrcs.end()) return;