]> git.sesse.net Git - vlc/commitdiff
only emit rateChanged when it has changed
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 8 Sep 2007 15:08:54 +0000 (15:08 +0000)
committerIlkka Ollakka <ileoo@videolan.org>
Sat, 8 Sep 2007 15:08:54 +0000 (15:08 +0000)
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp

index 6f8e175ef1670d1ff4da6098608d211bf8aeb45c..2a04b40fec502d6f074d63b08bb4da14457e5cee 100644 (file)
@@ -40,6 +40,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
     i_old_playing_status = END_S;
     old_name="";
     p_input = NULL;
+    i_rate = 0;
     ON_TIMEOUT( update() );
 }
 
@@ -101,8 +102,13 @@ void InputManager::update()
     f_pos = var_GetFloat( p_input, "position" );
     emit positionUpdated( f_pos, i_time, i_length );
     
-    /* Update rate */
-    emit rateChanged( var_GetInteger( p_input, "rate") );
+    int i_new_rate = var_GetInteger( p_input, "rate");
+    if( i_new_rate != i_rate )
+    {
+        i_rate = i_new_rate;
+        /* Update rate */
+        emit rateChanged( i_rate );
+    }
 
     /* Update navigation status */
     vlc_value_t val; val.i_int = 0;
index 9e75acbb312e950651a443ce1f50d4bc6c3d46ee..295fdbded41cfe10b004405cd46c1fb3233317b7 100644 (file)
@@ -46,6 +46,7 @@ private:
     input_thread_t *p_input;
     int i_old_playing_status;
     QString old_name;
+    int i_rate;
 public slots:
     void togglePlayPause();
     void update(); ///< Periodic updates