[vlc-commits] commit: Fixed potential infinite loop between input/ qt4 regarding input speed. (Laurent Aimar )

git at videolan.org git at videolan.org
Fri Mar 26 01:47:28 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Mar 26 01:15:03 2010 +0100| [aa306dc6d2e7b0f91bd7a4605b6709f627c9b2c1] | committer: Laurent Aimar 

Fixed potential infinite loop between input/qt4 regarding input speed.

and fixes for sure duplicated input speed settings done by qt4 when
changing rate.

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

 modules/gui/qt4/components/interface_widgets.cpp |    6 ++++++
 modules/gui/qt4/components/interface_widgets.hpp |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 756630b..ec5f29e 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -503,6 +503,8 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
     speedControlLayout->addWidget( speedSlider );
     speedControlLayout->addWidget( normalSpeedButton );
 
+    lastValue = 0;
+
     activateOnState();
 }
 
@@ -530,12 +532,16 @@ void SpeedControlWidget::updateControls( float rate )
     {
         sliderValue = speedSlider->maximum();
     }
+    lastValue = sliderValue;
 
     speedSlider->setValue( sliderValue );
 }
 
 void SpeedControlWidget::updateRate( int sliderValue )
 {
+    if( sliderValue == lastValue )
+        return;
+
     double speed = pow( 2, (double)sliderValue / 17 );
     int rate = INPUT_RATE_DEFAULT / speed;
 
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 58c23f1..9f46f10 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -189,6 +189,7 @@ public:
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
+    int lastValue;
 
 public slots:
     void activateOnState();



More information about the vlc-commits mailing list