mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-13 18:52:54 +00:00
Fix initial video duration display.
This commit is contained in:
parent
b5eb88a32f
commit
22356eb01c
@ -199,7 +199,7 @@ rpl::producer<crl::time> AudioTrack::playPosition() {
|
|||||||
_waitingForData.fire({});
|
_waitingForData.fire({});
|
||||||
}
|
}
|
||||||
_playPosition = std::clamp(
|
_playPosition = std::clamp(
|
||||||
((state.position * 1000 + (state.frequency / 2))
|
crl::time((state.position * 1000 + (state.frequency / 2))
|
||||||
/ state.frequency),
|
/ state.frequency),
|
||||||
crl::time(0),
|
crl::time(0),
|
||||||
_stream.duration - 1);
|
_stream.duration - 1);
|
||||||
|
@ -662,7 +662,7 @@ Media::Player::TrackState Player::prepareLegacyState() const {
|
|||||||
if (duration > 0) {
|
if (duration > 0) {
|
||||||
result.length = duration * crl::time(1000);
|
result.length = duration * crl::time(1000);
|
||||||
} else {
|
} else {
|
||||||
result.length = std::max(result.position, crl::time(0));
|
result.length = std::max(crl::time(result.position), crl::time(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.frequency = kMsFrequency;
|
result.frequency = kMsFrequency;
|
||||||
|
@ -2211,7 +2211,9 @@ void OverlayWidget::restartAtSeekPosition(crl::time position) {
|
|||||||
}
|
}
|
||||||
auto options = Streaming::PlaybackOptions();
|
auto options = Streaming::PlaybackOptions();
|
||||||
options.position = position;
|
options.position = position;
|
||||||
if (_doc->isAnimation()) {
|
options.audioId = AudioMsgId(_doc, _msgid);
|
||||||
|
if (_doc->isAnimation()
|
||||||
|
|| options.audioId.type() == AudioMsgId::Type::Unknown) {
|
||||||
options.mode = Streaming::Mode::Video;
|
options.mode = Streaming::Mode::Video;
|
||||||
options.loop = true;
|
options.loop = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user