diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index 564ac6810..1eaad5e98 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -964,6 +964,14 @@ void GroupCall::rejoinWithHash(const QString &hash) { } void GroupCall::setJoinAs(not_null as) { + if (_joinAs != as) { + if (_cameraOutgoing) { + _cameraOutgoing->setState(Webrtc::VideoState::Inactive); + } + if (_screenOutgoing) { + _screenOutgoing->setState(Webrtc::VideoState::Inactive); + } + } _joinAs = as; if (const auto chat = _peer->asChat()) { chat->setGroupCallDefaultJoinAs(_joinAs->id); @@ -1650,6 +1658,10 @@ void GroupCall::ensureOutgoingVideo() { if (!_cameraCapture) { _cameraCapture = _delegate->groupCallGetVideoCapture( _cameraInputId); + if (!_cameraCapture) { + _cameraOutgoing->setState(Webrtc::VideoState::Inactive); + return; + } } else { _cameraCapture->switchToDevice(_cameraInputId.toStdString()); } @@ -1678,6 +1690,18 @@ void GroupCall::ensureOutgoingVideo() { tgcalls::VideoCaptureInterface::Create( tgcalls::StaticThreads::getThreads(), _screenDeviceId.toStdString())); + if (!_screenCapture) { + _screenOutgoing->setState(Webrtc::VideoState::Inactive); + return; + } + const auto weak = base::make_weak(this); + _screenCapture->setOnFatalError([=] { + crl::on_main(weak, [=] { + _screenOutgoing->setState( + Webrtc::VideoState::Inactive); + // #TODO calls show error toast, receive here device. + }); + }); } else { _screenCapture->switchToDevice(_screenDeviceId.toStdString()); } diff --git a/Telegram/ThirdParty/tgcalls b/Telegram/ThirdParty/tgcalls index 63dcf796d..9a2b95507 160000 --- a/Telegram/ThirdParty/tgcalls +++ b/Telegram/ThirdParty/tgcalls @@ -1 +1 @@ -Subproject commit 63dcf796d7721e02ee179c61aec7045b2699a3eb +Subproject commit 9a2b95507fe19de2e969517453ae0874fbe1ae62