|
|
|
|
@ -129,7 +129,8 @@ void CallAudioEngine::setPlaybackDevice(const QString& id) {
|
|
|
|
|
void CallAudioEngine::setCaptureDevice(const QString& id) { |
|
|
|
|
if (id == m_captureId) return; |
|
|
|
|
m_captureId = id; |
|
|
|
|
m_capture.closeAsync(); m_voice.stopCapture(); m_capture.retryNow(); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
m_voice.stopCapture(); m_capture.retryNow(); |
|
|
|
|
m_captureError.clear(); emit captureErrorChanged(); |
|
|
|
|
if (m_active) { call_audio_reset_io(m_callId.load(), 0); recoverDevices(); } |
|
|
|
|
} |
|
|
|
|
@ -137,7 +138,8 @@ void CallAudioEngine::setCaptureDevice(const QString& id) {
|
|
|
|
|
void CallAudioEngine::beginEnd(quint64 callId) { |
|
|
|
|
if (!m_active || m_callId != callId || m_ending) return; |
|
|
|
|
m_ending = true; |
|
|
|
|
m_capture.closeAsync(); m_voice.stopCapture(); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
m_voice.stopCapture(); |
|
|
|
|
call_audio_begin_end(callId); |
|
|
|
|
uint64_t generation = m_generation; |
|
|
|
|
QTimer::singleShot(500, this, [this, generation]() { if (m_generation == generation) stop(); }); |
|
|
|
|
@ -146,7 +148,8 @@ void CallAudioEngine::beginEnd(quint64 callId) {
|
|
|
|
|
void CallAudioEngine::stop() { |
|
|
|
|
++m_generation; |
|
|
|
|
m_active = false; |
|
|
|
|
m_capture.closeAsync(); m_voice.stopCapture(); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
m_voice.stopCapture(); |
|
|
|
|
SoundManager::instance()->detachVoice(&m_voice); m_outputAttached = false; |
|
|
|
|
m_voice.stop(); |
|
|
|
|
if (m_capture.closing()) m_recoveryTimer.start(); |
|
|
|
|
|