mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Fix crash in joining active video chat.
This commit is contained in:
parent
a730c88491
commit
64243d1437
1 changed files with 19 additions and 8 deletions
|
@ -1243,16 +1243,27 @@ void Panel::setupPinnedVideo() {
|
||||||
}
|
}
|
||||||
_call->videoStreamActiveUpdates(
|
_call->videoStreamActiveUpdates(
|
||||||
) | rpl::start_with_next([=](const VideoEndpoint &endpoint) {
|
) | rpl::start_with_next([=](const VideoEndpoint &endpoint) {
|
||||||
|
if (_call->activeVideoTracks().contains(endpoint)) {
|
||||||
|
// Add async (=> the participant row is definitely in Members).
|
||||||
|
crl::on_main(_pinnedVideoWrap.get(), [=] {
|
||||||
const auto &tracks = _call->activeVideoTracks();
|
const auto &tracks = _call->activeVideoTracks();
|
||||||
const auto i = tracks.find(endpoint);
|
const auto i = tracks.find(endpoint);
|
||||||
if (i != end(tracks)) {
|
if (i != end(tracks)) {
|
||||||
_videoTiles.push_back(setupTile(endpoint, i->second));
|
_videoTiles.push_back(setupTile(endpoint, i->second));
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
_videoTiles.erase(
|
// Remove sync.
|
||||||
ranges::remove(_videoTiles, endpoint, &VideoTile::endpoint),
|
const auto eraseTill = end(_videoTiles);
|
||||||
end(_videoTiles));
|
const auto eraseFrom = ranges::remove(
|
||||||
|
_videoTiles,
|
||||||
|
endpoint,
|
||||||
|
&VideoTile::endpoint);
|
||||||
|
if (eraseFrom != eraseTill) {
|
||||||
|
_videoTiles.erase(eraseFrom, eraseTill);
|
||||||
refreshTilesGeometry();
|
refreshTilesGeometry();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, _pinnedVideoWrap->lifetime());
|
}, _pinnedVideoWrap->lifetime());
|
||||||
|
|
||||||
_pinnedVideoWrap->sizeValue() | rpl::start_with_next([=] {
|
_pinnedVideoWrap->sizeValue() | rpl::start_with_next([=] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue