Couple of crash fixes.

This commit is contained in:
John Preston 2021-09-13 17:39:17 +03:00
parent 3bf9a1c70b
commit ce256161f1
3 changed files with 11 additions and 6 deletions

View File

@ -35,6 +35,14 @@ Viewport::VideoTile::VideoTile(
Expects(track.track != nullptr);
Expects(track.row != nullptr);
using namespace rpl::mappers;
_track.track->stateValue(
) | rpl::filter(
_1 == Webrtc::VideoState::Paused
) | rpl::take(1) | rpl::start_with_next([=] {
_wasPaused = true;
}, _lifetime);
setup(std::move(pinned));
}
@ -68,11 +76,8 @@ QSize Viewport::VideoTile::PausedVideoSize() {
QSize Viewport::VideoTile::trackOrUserpicSize() const {
if (const auto size = trackSize(); !size.isEmpty()) {
return size;
} else if (_userpicSize.isEmpty()
&& _track.track->state() == Webrtc::VideoState::Paused) {
_userpicSize = PausedVideoSize();
}
return _userpicSize;
return _wasPaused ? PausedVideoSize() : QSize();
}
bool Viewport::VideoTile::screencast() const {

View File

@ -110,12 +110,12 @@ private:
QRect _geometry;
TileAnimation _animation;
rpl::variable<QSize> _trackSize;
mutable QSize _userpicSize;
QRect _pinOuter;
QRect _pinInner;
QRect _backOuter;
QRect _backInner;
Ui::Animations::Simple _topControlsShownAnimation;
bool _wasPaused = false;
bool _topControlsShown = false;
bool _pinned = false;
bool _hidden = true;

@ -1 +1 @@
Subproject commit 8d634fc9460569b24186858f9eb65c3e3be97271
Subproject commit 8589a8d8501701e1b93f9752abdaf1740e6d0517