Skip to content
Snippets Groups Projects
Commit a59d3f9d authored by Pierre Lamot's avatar Pierre Lamot Committed by Steve Lhomme
Browse files

qt: update rounding method for displaying playback time

parent d1482d8b
No related branches found
No related tags found
1 merge request!5640qt: update rounding method for displaying playback time
Pipeline #485393 passed with stage
in 11 minutes and 56 seconds
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment