[vlc-commits] qt: don't let VLCTick::scale to cause decay into VLC_TICK_INVALID

Fatih Uzunoglu git at videolan.org
Mon Nov 16 10:04:20 CET 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Wed Aug 19 20:08:47 2020 +0300| [b0d2777e68864ceb79a23adc00952baba37e97f2] | committer: Pierre Lamot

qt: don't let VLCTick::scale to cause decay into VLC_TICK_INVALID

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b0d2777e68864ceb79a23adc00952baba37e97f2
---

 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



More information about the vlc-commits mailing list