[vlc-commits] [Git][videolan/vlc][master] qt: reflect rate change immediately

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Jan 12 11:28:08 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
56665e5d by Fatih Uzunoglu at 2025-01-12T11:12:15+00:00
qt: reflect rate change immediately

If the change ends up being different, then
it can be corrected later when the timer
provides the update.

The user should not wait couple of seconds
for the timer to update the rate for normal
cases. For position, it is interpolated but
for the rate I propose using the requested
rate as is.

- - - - -


1 changed file:

- modules/gui/qt/player/player_controller.cpp


Changes:

=====================================
modules/gui/qt/player/player_controller.cpp
=====================================
@@ -1220,10 +1220,23 @@ void PlayerController::reverse()
 void PlayerController::setRate( float new_rate )
 {
     Q_D(PlayerController);
+
+    if (qFuzzyCompare(d->m_rate, new_rate))
+        return;
+
     msg_Dbg( d->p_intf, "setRate %f", new_rate);
     vlc_player_locker lock{ d->m_player };
     if ( vlc_player_CanChangeRate( d->m_player ) )
+    {
         vlc_player_ChangeRate( d->m_player, new_rate );
+
+        // Until the timer notifies the change, we need to still change
+        // the rate, because player timer update may take a long time.
+        // For position, it is supposed to be interpolated but for rate
+        // the new value can be taken as is:
+        d->m_rate = new_rate;
+        emit rateChanged(d->m_rate);
+    }
 }
 
 void PlayerController::slower()



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/56665e5dc8a94099e023974c372381e0fe56a7d3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/56665e5dc8a94099e023974c372381e0fe56a7d3
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list