From f36240eb3833935e1e4d951e8a88867e3a3a7237 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Aug 2020 13:55:09 +0400 Subject: [PATCH] Check for at least one camera existance. --- Telegram/SourceFiles/calls/calls_call.cpp | 6 +++++- Telegram/lib_webrtc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index c2d2a9604..f23e83b23 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/base_platform_info.h" #include "calls/calls_panel.h" #include "webrtc/webrtc_video_track.h" +#include "webrtc/webrtc_camera_utilities.h" #include "data/data_user.h" #include "data/data_session.h" #include "facades.h" @@ -348,7 +349,10 @@ void Call::setupOutgoingVideo() { const auto started = _videoOutgoing->state(); _videoOutgoing->stateValue( ) | rpl::start_with_next([=](Webrtc::VideoState state) { - if (_state.current() != State::Established + if (state != Webrtc::VideoState::Inactive + && Webrtc::GetCamerasList().empty()) { + _videoOutgoing->setState(Webrtc::VideoState::Inactive); + } else if (_state.current() != State::Established && state != started && !_videoCapture) { _videoOutgoing->setState(started); diff --git a/Telegram/lib_webrtc b/Telegram/lib_webrtc index 39234aa82..4d0f0b8ef 160000 --- a/Telegram/lib_webrtc +++ b/Telegram/lib_webrtc @@ -1 +1 @@ -Subproject commit 39234aa82a0bd0eceaf9b299a2debdb513ef7381 +Subproject commit 4d0f0b8ef41b7a7f8014cebb1dbc5549b06fde6f