Skip to content

Commit

Permalink
Check for at least one camera existance.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 21, 2020
1 parent 72861a6 commit f36240e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Telegram/SourceFiles/calls/calls_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ For license and copyright information please follow this link:
#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"
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Telegram/lib_webrtc

0 comments on commit f36240e

Please sign in to comment.