diff --git a/src/client/videomanager.cpp b/src/client/videomanager.cpp index 775acc1e24ce446a8d802ec2d2fc4fd224341ead..6d96d8ea8da662b8e5e84aa0dc9108163849987b 100644 --- a/src/client/videomanager.cpp +++ b/src/client/videomanager.cpp @@ -457,8 +457,7 @@ startCamera() void stopCamera() { - if (switchInput("")) - jami::Manager::instance().getVideoManager().started = false; + jami::Manager::instance().getVideoManager().started = false; jami::Manager::instance().getVideoManager().videoPreview.reset(); } @@ -467,6 +466,7 @@ startAudioDevice() { jami::Manager::instance().getVideoManager().audioPreview = jami::getAudioInput( jami::RingBufferPool::DEFAULT_ID); + jami::Manager::instance().getVideoManager().audioPreview->switchInput(""); } void @@ -520,20 +520,13 @@ stopLocalRecorder(const std::string& filepath) bool switchInput(const std::string& resource) { - if (auto call = jami::Manager::instance().getCurrentCall()) { - if (call->hasVideo()) { - // TODO remove this part when clients are updated to use Calljami::Manager::switchInput - call->switchInput(resource); - return true; - } - } bool ret = true; if (auto input = jami::Manager::instance().getVideoManager().videoInput.lock()) ret = input->switchInput(resource).valid(); else JAMI_WARN("Video input not initialized"); - if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID)) + if (auto input = jami::Manager::instance().getVideoManager().audioPreview) ret &= input->switchInput(resource).valid(); return ret; }