mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-26 00:12:25 +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({});
|
||||
}
|
||||
_playPosition = std::clamp(
|
||||
((state.position * 1000 + (state.frequency / 2))
|
||||
crl::time((state.position * 1000 + (state.frequency / 2))
|
||||
/ state.frequency),
|
||||
crl::time(0),
|
||||
_stream.duration - 1);
|
||||
|
@ -662,7 +662,7 @@ Media::Player::TrackState Player::prepareLegacyState() const {
|
||||
if (duration > 0) {
|
||||
result.length = duration * crl::time(1000);
|
||||
} else {
|
||||
result.length = std::max(result.position, crl::time(0));
|
||||
result.length = std::max(crl::time(result.position), crl::time(0));
|
||||
}
|
||||
}
|
||||
result.frequency = kMsFrequency;
|
||||
|
@ -2211,7 +2211,9 @@ void OverlayWidget::restartAtSeekPosition(crl::time position) {
|
||||
}
|
||||
auto options = Streaming::PlaybackOptions();
|
||||
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.loop = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user