Commit a0873b2c authored by Yuval Tze's avatar Yuval Tze Committed by Rémi Denis-Courmont

Subtitles duration factor bug fix

The subtitles duration factor change on the SyncControls widget constructor caused the subsdelay filter to be activated when the synchronization dialog was first opened.

- Subtitles duration update was moved to the update function (which turns b_userAction off before updating)
- updateSubsDuration was renamed to initSubsDuration
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 5f5704a0
...@@ -1617,9 +1617,10 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -1617,9 +1617,10 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
BUTTON_SET_ACT_I( updateButton, "", update, BUTTON_SET_ACT_I( updateButton, "", update,
qtr( "Force update of this dialog's values" ), update() ); qtr( "Force update of this dialog's values" ), update() );
initSubsDuration();
/* Set it */ /* Set it */
update(); update();
updateSubsDuration();
} }
SyncControls::~SyncControls() SyncControls::~SyncControls()
...@@ -1634,7 +1635,6 @@ void SyncControls::clean() ...@@ -1634,7 +1635,6 @@ void SyncControls::clean()
subsSpin->setValue( 0.0 ); subsSpin->setValue( 0.0 );
subSpeedSpin->setValue( 1.0 ); subSpeedSpin->setValue( 1.0 );
subsdelayClean(); subsdelayClean();
updateSubsDuration();
b_userAction = true; b_userAction = true;
} }
...@@ -1650,6 +1650,7 @@ void SyncControls::update() ...@@ -1650,6 +1650,7 @@ void SyncControls::update()
i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" ); i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" );
subsSpin->setValue( ( (double)i_delay ) / 1000000 ); subsSpin->setValue( ( (double)i_delay ) / 1000000 );
subSpeedSpin->setValue( var_GetFloat( THEMIM->getInput(), "sub-fps" ) ); subSpeedSpin->setValue( var_GetFloat( THEMIM->getInput(), "sub-fps" ) );
subDurationSpin->setValue( var_InheritFloat( p_intf, SUBSDELAY_CFG_FACTOR ) );
} }
b_userAction = true; b_userAction = true;
} }
...@@ -1689,7 +1690,7 @@ void SyncControls::adjustSubsDuration( double f_factor ) ...@@ -1689,7 +1690,7 @@ void SyncControls::adjustSubsDuration( double f_factor )
} }
} }
void SyncControls::updateSubsDuration() void SyncControls::initSubsDuration()
{ {
int i_mode = var_InheritInteger( p_intf, SUBSDELAY_CFG_MODE ); int i_mode = var_InheritInteger( p_intf, SUBSDELAY_CFG_MODE );
...@@ -1713,8 +1714,6 @@ void SyncControls::updateSubsDuration() ...@@ -1713,8 +1714,6 @@ void SyncControls::updateSubsDuration()
subDurationSpin->setSuffix( "" ); subDurationSpin->setSuffix( "" );
break; break;
} }
subDurationSpin->setValue( var_InheritFloat( p_intf, SUBSDELAY_CFG_FACTOR ) );
} }
void SyncControls::subsdelayClean() void SyncControls::subsdelayClean()
......
...@@ -186,7 +186,7 @@ private: ...@@ -186,7 +186,7 @@ private:
void clean(); void clean();
void updateSubsDuration(); void initSubsDuration();
void subsdelayClean(); void subsdelayClean();
void subsdelaySetFactor( double ); void subsdelaySetFactor( double );
public slots: public slots:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment