Change round video playback duration to countdown.

This commit is contained in:
John Preston 2017-05-18 19:09:45 +03:00
parent efb59e8c3a
commit 8446fa5a4d
1 changed files with 11 additions and 1 deletions

View File

@ -2297,7 +2297,17 @@ void HistoryGif::updateStatusText() const {
statusSize = FileStatusSizeLoaded;
if (_gif && _gif->mode() == Media::Clip::Reader::Mode::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 {
statusSize = FileStatusSizeReady;