[vlc-commits] [Git][videolan/vlc][master] qt: update rounding method for displaying playback time
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Jun 27 05:33:27 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
a59d3f9d by Pierre Lamot at 2024-06-27T05:20:07+00:00
qt: update rounding method for displaying playback time
- - - - -
2 changed files:
- modules/gui/qt/util/vlctick.cpp
- modules/gui/qt/util/vlctick.hpp
Changes:
=====================================
modules/gui/qt/util/vlctick.cpp
=====================================
@@ -58,8 +58,7 @@ QString VLCTick::formatHMS() const
int64_t t_ms = MS_FROM_VLC_TICK(m_ticks);
if (t_ms >= 1000)
{
- //round to the nearest second
- t_ms = roundNearestMultiple(t_ms, 1000);
+ //truncate milliseconds toward 0
int64_t t_sec = t_ms / 1000;
int sec = t_sec % 60;
int min = (t_sec / 60) % 60;
=====================================
modules/gui/qt/util/vlctick.hpp
=====================================
@@ -40,6 +40,11 @@ public:
/**
* @brief formatHMS
* @return time as HH:MM:SS
+ *
+ * this method should be used to present running time or
+ * time that will be compared to a running time
+ *
+ * milliseconds will be truncated towards 0
*/
Q_INVOKABLE QString formatHMS() const;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a59d3f9dd511301b822bd3368ec1bdce9462b809
--
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a59d3f9dd511301b822bd3368ec1bdce9462b809
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list