[vlc-devel] [PATCH] Subtitles duration factor bug fix

Yuval Tze yuvaltze at gmail.com
Mon Jun 13 20:59:05 CEST 2011


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
---
 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:
-- 
1.7.4.1




More information about the vlc-devel mailing list