Improved fix of crash in video messages playback.

Regression was introduced in ad3e447f08.
This commit is contained in:
23rd 2024-08-29 12:46:55 +03:00 committed by John Preston
parent 94e7aabea5
commit 0f94419f6d

View file

@ -670,6 +670,9 @@ void Widget::updateTimeLabel() {
void Widget::handleSongChange() { void Widget::handleSongChange() {
const auto current = instance()->current(_type); const auto current = instance()->current(_type);
const auto document = current.audio(); const auto document = current.audio();
_lastSongFromAnotherSession = document
&& (document->session().uniqueId()
!= _controller->session().uniqueId());
if (!current if (!current
|| !document || !document
|| ((_lastSongId.audio() == document) || ((_lastSongId.audio() == document)
@ -677,8 +680,6 @@ void Widget::handleSongChange() {
return; return;
} }
_lastSongId = current; _lastSongId = current;
_lastSongFromAnotherSession = (document->session().uniqueId()
!= _controller->session().uniqueId());
auto textWithEntities = TextWithEntities(); auto textWithEntities = TextWithEntities();
if (document->isVoiceMessage() || document->isVideoMessage()) { if (document->isVoiceMessage() || document->isVideoMessage()) {