emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mpv 27b98410e5 45/50: Fix decreasing volume or speed by mu


From: ELPA Syncer
Subject: [nongnu] elpa/mpv 27b98410e5 45/50: Fix decreasing volume or speed by multiple steps
Date: Tue, 28 Dec 2021 00:58:43 -0500 (EST)

branch: elpa/mpv
commit 27b98410e5b53eae62c5fe567e29dbf665fc77f8
Author: c1-g <char1iegordon@protonmail.com>
Commit: Johann Klähn <johann@jklaehn.de>

    Fix decreasing volume or speed by multiple steps
---
 mpv.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/mpv.el b/mpv.el
index d99d9ff206..5b9847538e 100644
--- a/mpv.el
+++ b/mpv.el
@@ -316,10 +316,9 @@ This can be used with the `org-open-at-point-functions' 
hook."
 (defun mpv-speed-increase (steps)
   "Increase playback speed by STEPS factors of `mpv-speed-step'."
   (interactive "p")
-  (let ((factor (* (abs steps)
-                   (if (> steps 0)
-                       mpv-speed-step
-                     (/ 1 mpv-speed-step)))))
+  (let ((factor (if (>= steps 0)
+                    (* steps mpv-speed-step)
+                  (/ 1 (* (- steps) mpv-speed-step)))))
     (mpv--enqueue `("multiply" "speed" ,factor) #'ignore)))
 
 ;;;###autoload
@@ -338,10 +337,9 @@ This can be used with the `org-open-at-point-functions' 
hook."
 (defun mpv-volume-increase (steps)
   "Increase playback volume by STEPS factors of `mpv-volume-step'."
   (interactive "p")
-  (let ((factor (* (abs steps)
-                   (if (> steps 0)
-                       mpv-volume-step
-                     (/ 1 mpv-volume-step)))))
+  (let ((factor (if (>= steps 0)
+                    (* steps mpv-volume-step)
+                  (/ 1 (* (- steps) mpv-volume-step)))))
     (mpv--enqueue `("multiply" "volume" ,factor) #'ignore)))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]