Fix possible infinite recursion in video calls.

This commit is contained in:
John Preston 2020-12-24 14:38:46 +04:00
parent 0dc0f588c4
commit 1951b7a8a1

View file

@ -368,10 +368,10 @@ void Call::setupOutgoingVideo() {
_errors.fire({ ErrorType::NoCamera }); _errors.fire({ ErrorType::NoCamera });
_videoOutgoing->setState(Webrtc::VideoState::Inactive); _videoOutgoing->setState(Webrtc::VideoState::Inactive);
} else if (_state.current() != State::Established } else if (_state.current() != State::Established
&& state != started && (state != Webrtc::VideoState::Inactive)
&& !_videoCapture) { && (started == Webrtc::VideoState::Inactive)) {
_errors.fire({ ErrorType::NotStartedCall }); _errors.fire({ ErrorType::NotStartedCall });
_videoOutgoing->setState(started); _videoOutgoing->setState(Webrtc::VideoState::Inactive);
} else if (state != Webrtc::VideoState::Inactive } else if (state != Webrtc::VideoState::Inactive
&& _instance && _instance
&& !_instance->supportsVideo()) { && !_instance->supportsVideo()) {