Own publication independently of its window and reserve call capture

This commit is contained in:
evgeny committed 2026-10-14 02:54:19 +02:00
1 parent ab01c6dc48
commit c1d7460254
3 files changed
+18 -1

No files matched your search

+6 -1
View File
@@ -33,13 +33,17 @@ CallAudioEngine::CallAudioEngine() {
int CallAudioEngine::start(quint64 callId) {
if (m_active && m_callId == callId && !m_ending) return 0;
stop();
if (!m_microphone.acquire()) {
DEBUG_WARN(DEBUG_CATEGORY_CALL, "CallAudio: microphone owned by another operation"); return -1;
}
if (!gui_bridge_get_inst() || call_audio_start_prepared(callId) != 0) {
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "CallAudio: cannot start call=%016llx", (unsigned long long)callId);
m_microphone.release();
return -1;
}
++m_generation;
m_callId = callId;
if (!m_voice.start(VoiceAudioIo::Kind::Call, callId)) { call_audio_release(callId); m_callId = 0; return -1; }
if (!m_voice.start(VoiceAudioIo::Kind::Call, callId)) { call_audio_release(callId); m_callId = 0; m_microphone.release(); return -1; }
m_muted = false;
m_ending = false;
m_active = true;
@@ -127,6 +131,7 @@ void CallAudioEngine::stop() {
m_recoveryTimer.stop();
m_active = false;
pauseDevices(); m_voice.stop();
m_microphone.release();
uint64_t id = m_callId.exchange(0);
if (id) call_audio_release(id);
m_muted = false;