[vlc-commits] qt: use VLC_TICK_INVALID for uninitialized timeA/timeB values
Steve Lhomme
git at videolan.org
Tue Sep 18 14:08:19 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jun 12 12:33:53 2018 +0200| [d88f4725a53013c6d3b2079c3ceb51cb64f4ce0f] | committer: Steve Lhomme
qt: use VLC_TICK_INVALID for uninitialized timeA/timeB values
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d88f4725a53013c6d3b2079c3ceb51cb64f4ce0f
---
modules/gui/qt/input_manager.cpp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 03d38430a3..98b9856f7d 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -74,8 +74,8 @@ InputManager::InputManager( MainInputManager *mim, intf_thread_t *_p_intf) :
f_rate = 0.;
p_item = NULL;
b_video = false;
- timeA = 0;
- timeB = 0;
+ timeA = VLC_TICK_INVALID;
+ timeB = VLC_TICK_INVALID;
f_cache = -1.; /* impossible initial value, different from all */
registerAndCheckEventIds( IMEvent::PositionUpdate, IMEvent::FullscreenControlPlanHide );
registerAndCheckEventIds( PLEvent::PLItemAppended, PLEvent::PLEmpty );
@@ -178,8 +178,8 @@ void InputManager::delInput()
oldName = "";
artUrl = "";
b_video = false;
- timeA = 0;
- timeB = 0;
+ timeA = VLC_TICK_INVALID;
+ timeB = VLC_TICK_INVALID;
f_rate = 0. ;
if( p_input_vbi )
@@ -938,11 +938,11 @@ void InputManager::jumpBwd()
void InputManager::setAtoB()
{
- if( !timeA )
+ if( timeA != VLC_TICK_INVALID )
{
timeA = var_GetInteger( p_mim->getInput(), "time" );
}
- else if( !timeB )
+ else if( timeB != VLC_TICK_INVALID )
{
timeB = var_GetInteger( p_mim->getInput(), "time" );
var_SetInteger( p_mim->getInput(), "time" , timeA );
@@ -951,18 +951,18 @@ void InputManager::setAtoB()
}
else
{
- timeA = 0;
- timeB = 0;
+ timeA = VLC_TICK_INVALID;
+ timeB = VLC_TICK_INVALID;
disconnect( this, SIGNAL( positionUpdated( float, int64_t, int ) ),
this, SLOT( AtoBLoop( float, vlc_tick_t, int ) ) );
}
- emit AtoBchanged( (timeA != 0 ), (timeB != 0 ) );
+ emit AtoBchanged( (timeA != VLC_TICK_INVALID ), (timeB != VLC_TICK_INVALID ) );
}
/* Function called regularly when in an AtoB loop */
void InputManager::AtoBLoop( float, vlc_tick_t i_time, int )
{
- if( timeB && i_time >= timeB )
+ if( timeB != VLC_TICK_INVALID && i_time >= timeB )
var_SetInteger( p_mim->getInput(), "time" , timeA );
}
More information about the vlc-commits
mailing list