[vlc-commits] Seek only if the position actually changed.

Tobias Güntner git at videolan.org
Wed Feb 1 22:17:21 CET 2012


vlc | branch: master | Tobias Güntner <fatbull at web.de> | Fri Jan 20 23:08:06 2012 +0100| [2b60e15e4f8f0a76818086c8fee6cc554edf3b78] | committer: Jean-Baptiste Kempf

Seek only if the position actually changed.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/util/input_slider.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index 4577e2f..b4edba0 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -167,6 +167,7 @@ void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
 {
     event->accept();
     b_isSliding = false;
+    bool b_seekPending = seekLimitTimer->isActive();
     seekLimitTimer->stop(); /* We're not sliding anymore: only last seek on release */
     if ( b_is_jumping )
     {
@@ -174,7 +175,8 @@ void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
         return;
     }
     QSlider::mouseReleaseEvent( event );
-    updatePos();
+    if( b_seekPending )
+        updatePos();
 }
 
 void SeekSlider::mousePressEvent( QMouseEvent* event )
@@ -227,6 +229,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
 
     b_isSliding = true ;
     setValue( QStyle::sliderValueFromPosition( MINIMUM, MAXIMUM, event->x(), width(), false ) );
+    emit sliderMoved( value() );
     event->accept();
 }
 



More information about the vlc-commits mailing list