[vlc-commits] Subtitles duration factor bug fix

Yuval Tze git at videolan.org
Tue Jun 14 22:05:19 CEST 2011


vlc | branch: master | Yuval Tze <yuvaltze at gmail.com> | Mon Jun 13 21:59:05 2011 +0300| [a0873b2c75aabba279ad3ae8812972ac21b82ea6] | committer: 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: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/gui/qt4/components/extended_panels.cpp |    9 ++++-----
 modules/gui/qt4/components/extended_panels.hpp |    2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 340e49a..b3f5501 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -1617,9 +1617,10 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
     BUTTON_SET_ACT_I( updateButton, "", update,
             qtr( "Force update of this dialog's values" ), update() );
 
+    initSubsDuration();
+
     /* Set it */
     update();
-    updateSubsDuration();
 }
 
 SyncControls::~SyncControls()
@@ -1634,7 +1635,6 @@ void SyncControls::clean()
     subsSpin->setValue( 0.0 );
     subSpeedSpin->setValue( 1.0 );
     subsdelayClean();
-    updateSubsDuration();
     b_userAction = true;
 }
 
@@ -1650,6 +1650,7 @@ void SyncControls::update()
         i_delay = var_GetTime( THEMIM->getInput(), "spu-delay" );
         subsSpin->setValue( ( (double)i_delay ) / 1000000 );
         subSpeedSpin->setValue( var_GetFloat( THEMIM->getInput(), "sub-fps" ) );
+        subDurationSpin->setValue( var_InheritFloat( p_intf, SUBSDELAY_CFG_FACTOR ) );
     }
     b_userAction = true;
 }
@@ -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 );
 
@@ -1713,8 +1714,6 @@ void SyncControls::updateSubsDuration()
         subDurationSpin->setSuffix( "" );
         break;
     }
-
-    subDurationSpin->setValue( var_InheritFloat( p_intf, SUBSDELAY_CFG_FACTOR ) );
 }
 
 void SyncControls::subsdelayClean()
diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp
index 6883761..3058338 100644
--- a/modules/gui/qt4/components/extended_panels.hpp
+++ b/modules/gui/qt4/components/extended_panels.hpp
@@ -186,7 +186,7 @@ private:
 
     void clean();
 
-    void updateSubsDuration();
+    void initSubsDuration();
     void subsdelayClean();
     void subsdelaySetFactor( double );
 public slots:



More information about the vlc-commits mailing list