[vlc-devel] [PATCH 15/21] qt: don't let VLCTick::scale to cause decay into VLC_TICK_INVALID

Fatih Uzunoglu fuzun54 at outlook.com
Sat Nov 7 17:53:34 CET 2020


---
 modules/gui/qt/util/vlctick.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/util/vlctick.cpp b/modules/gui/qt/util/vlctick.cpp
index ed7b0cec88..381bf9a715 100644
--- a/modules/gui/qt/util/vlctick.cpp
+++ b/modules/gui/qt/util/vlctick.cpp
@@ -61,7 +61,10 @@ QString VLCTick::toString() const
 
 VLCTick VLCTick::scale(float scalar) const
 {
-    return VLCTick(m_ticks*scalar);
+    if (scalar == 0.0f)
+        return VLCTick(VLC_TICK_0); // to not decay to VLC_TICK_INVALID
+
+    return VLCTick(m_ticks * scalar);
 }
 
 int VLCTick::toSeconds() const
-- 
2.25.1



More information about the vlc-devel mailing list