mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Change round video playback duration to countdown.
This commit is contained in:
parent
efb59e8c3a
commit
8446fa5a4d
1 changed files with 11 additions and 1 deletions
|
@ -2297,7 +2297,17 @@ void HistoryGif::updateStatusText() const {
|
||||||
statusSize = FileStatusSizeLoaded;
|
statusSize = FileStatusSizeLoaded;
|
||||||
if (_gif && _gif->mode() == Media::Clip::Reader::Mode::Video) {
|
if (_gif && _gif->mode() == Media::Clip::Reader::Mode::Video) {
|
||||||
auto state = Media::Player::mixer()->currentState(AudioMsgId::Type::Video);
|
auto state = Media::Player::mixer()->currentState(AudioMsgId::Type::Video);
|
||||||
statusSize = -1 - (state.position / state.frequency);
|
if (state.length) {
|
||||||
|
auto position = int64(0);
|
||||||
|
if (!Media::Player::IsStopped(state.state) && state.state != Media::Player::State::Finishing) {
|
||||||
|
position = state.position;
|
||||||
|
} else if (state.state == Media::Player::State::StoppedAtEnd) {
|
||||||
|
position = state.length;
|
||||||
|
}
|
||||||
|
statusSize = -1 - ((state.length - position) / state.frequency);
|
||||||
|
} else {
|
||||||
|
statusSize = -1 - _data->duration();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
statusSize = FileStatusSizeReady;
|
statusSize = FileStatusSizeReady;
|
||||||
|
|
Loading…
Add table
Reference in a new issue