]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/controller_widget.cpp
Qt: Fix the bug where the volume was losing 1% at each start
[vlc] / modules / gui / qt4 / components / controller_widget.cpp
index fbb19becad3f92a97783ab8a360064a1259475f6..db295423b69f3765db64d7a4ba4eff79ca71cb45 100644 (file)
@@ -111,8 +111,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
         layout->addWidget( volumeSlider, 0, Qt::AlignBottom  );
 
     /* Set the volume from the config */
-    volumeSlider->setValue( config_GetInt( p_intf, "volume" ) ) *
-                              VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
+    volumeSlider->setValue( qRound( ( (qreal)config_GetInt( p_intf, "volume" ) ) *
+                              VOLUME_MAX / (AOUT_VOLUME_MAX/2) ) );
 
     /* Force the update at build time in order to have a muted icon if needed */
     updateVolume( volumeSlider->value() );