[vlc-commits] cli: remove gratuitious dependency on hotkeys

Rémi Denis-Courmont git at videolan.org
Sun Oct 18 20:49:42 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 18 21:49:05 2020 +0300| [84c3766d14017e3bebfea1026f9764d977608060] | committer: Rémi Denis-Courmont

cli: remove gratuitious dependency on hotkeys

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

 modules/control/cli/player.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/modules/control/cli/player.c b/modules/control/cli/player.c
index 9850c22025..1431eb1e52 100644
--- a/modules/control/cli/player.c
+++ b/modules/control/cli/player.c
@@ -33,7 +33,6 @@
 #include <vlc_aout.h>
 #include <vlc_vout.h>
 #include <vlc_player.h>
-#include <vlc_actions.h>
 
 #include "cli.h"
 
@@ -206,8 +205,12 @@ static void PlayerFastForward(intf_thread_t *intf, const char *const *args,
                               isgreater(rate, 0.f) ? rate * 2.f : -rate);
     }
     else
-        var_SetInteger(vlc_object_instance(intf), "key-action",
-                       ACTIONID_JUMP_FORWARD_EXTRASHORT);
+    {
+        int secs = var_InheritInteger(intf, "extrashort-jump-size");
+        vlc_tick_t t = vlc_player_GetTime(player) + vlc_tick_from_sec(secs);
+
+        vlc_player_SetTime(player, t);
+    }
     vlc_player_Unlock(player);
     (void) args; (void) count;
 }
@@ -225,8 +228,12 @@ static void PlayerRewind(intf_thread_t *intf, const char *const *args,
         vlc_player_ChangeRate(player, isless(rate, 0.f) ? rate * 2.f : -rate);
     }
     else
-        var_SetInteger(vlc_object_instance(intf), "key-action",
-                       ACTIONID_JUMP_BACKWARD_EXTRASHORT);
+    {
+        int secs = var_InheritInteger(intf, "extrashort-jump-size");
+        vlc_tick_t t = vlc_player_GetTime(player) - vlc_tick_from_sec(secs);
+
+        vlc_player_SetTime(player, t);
+    }
     vlc_player_Unlock(player);
     (void) args; (void) count;
 }



More information about the vlc-commits mailing list