mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix camera start.
This commit is contained in:
parent
35dfb9fab3
commit
aba8f72c36
2 changed files with 6 additions and 9 deletions
|
@ -159,10 +159,11 @@ Call::Call(
|
||||||
|
|
||||||
if (_type == Type::Outgoing) {
|
if (_type == Type::Outgoing) {
|
||||||
setState(State::Requesting);
|
setState(State::Requesting);
|
||||||
|
setupOutgoingVideo();
|
||||||
} else {
|
} else {
|
||||||
startWaitingTrack();
|
startWaitingTrack();
|
||||||
|
// setupOutgoingVideo will be called when we decide if it is enabled.
|
||||||
}
|
}
|
||||||
setupOutgoingVideo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Call::generateModExpFirst(bytes::const_span randomSeed) {
|
void Call::generateModExpFirst(bytes::const_span randomSeed) {
|
||||||
|
@ -337,9 +338,7 @@ void Call::setupOutgoingVideo() {
|
||||||
const auto started = _videoOutgoing->enabled();
|
const auto started = _videoOutgoing->enabled();
|
||||||
_videoOutgoing->enabledValue(
|
_videoOutgoing->enabledValue(
|
||||||
) | rpl::start_with_next([=](bool enabled) {
|
) | rpl::start_with_next([=](bool enabled) {
|
||||||
if (_state.current() != State::Established
|
if (_state.current() != State::Established && enabled != started) {
|
||||||
&& enabled != started
|
|
||||||
&& !(_type == Type::Incoming && !_id)) {
|
|
||||||
_videoOutgoing->setEnabled(started);
|
_videoOutgoing->setEnabled(started);
|
||||||
} else if (enabled) {
|
} else if (enabled) {
|
||||||
if (!_videoCapture) {
|
if (!_videoCapture) {
|
||||||
|
@ -464,12 +463,10 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are allowed to change it for non-established call
|
|
||||||
// only in case `incoming && !_id`, only when we just received it.
|
|
||||||
_videoOutgoing->setEnabled(data.is_video());
|
|
||||||
|
|
||||||
_id = data.vid().v;
|
_id = data.vid().v;
|
||||||
_accessHash = data.vaccess_hash().v;
|
_accessHash = data.vaccess_hash().v;
|
||||||
|
_videoOutgoing->setEnabled(data.is_video());
|
||||||
|
setupOutgoingVideo();
|
||||||
auto gaHashBytes = bytes::make_span(data.vg_a_hash().v);
|
auto gaHashBytes = bytes::make_span(data.vg_a_hash().v);
|
||||||
if (gaHashBytes.size() != kSha256Size) {
|
if (gaHashBytes.size() != kSha256Size) {
|
||||||
LOG(("Call Error: Wrong g_a_hash size %1, expected %2."
|
LOG(("Call Error: Wrong g_a_hash size %1, expected %2."
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 78e8e4ae7746f0ce5e56a15c4087d4ec997bec84
|
Subproject commit ab42b2bf87bbb53b83ac46cdc1d1285b6439d064
|
Loading…
Add table
Reference in a new issue