[gnome-settings-daemon/wip/hadess/more-mpris-fixes: 2/2] media-keys: Fix fast-forward and rewind keys
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/hadess/more-mpris-fixes: 2/2] media-keys: Fix fast-forward and rewind keys
- Date: Wed, 27 Oct 2021 12:40:12 +0000 (UTC)
commit 1970285578ff31abd58788e6f0ebe83c476fe533
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 27 14:39:18 2021 +0200
media-keys: Fix fast-forward and rewind keys
MPRIS's Seek method uses microseconds, not milliseconds.
plugins/media-keys/gsd-media-keys-manager.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 498a49cd..a38be7a8 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -101,8 +101,8 @@
#define TOUCHPAD_ENABLED_KEY "send-events"
#define HIGH_CONTRAST "HighContrast"
-#define REWIND_MSEC (-10 * 1000)
-#define FASTFORWARD_MSEC (45 * 1000)
+#define REWIND_USEC (-10 * G_USEC_PER_SEC)
+#define FASTFORWARD_USEC (45 * G_USEC_PER_SEC)
#define VOLUME_STEP "volume-step"
#define VOLUME_STEP_PRECISE 2
@@ -1719,10 +1719,10 @@ do_multimedia_player_action (GsdMediaKeysManager *manager,
if (mpris_controller_get_has_active_player (priv->mpris_controller)) {
if (g_str_equal (key, "Rewind")) {
- if (mpris_controller_seek (priv->mpris_controller, REWIND_MSEC))
+ if (mpris_controller_seek (priv->mpris_controller, REWIND_USEC))
return TRUE;
} else if (g_str_equal (key, "FastForward")) {
- if (mpris_controller_seek (priv->mpris_controller, FASTFORWARD_MSEC))
+ if (mpris_controller_seek (priv->mpris_controller, FASTFORWARD_USEC))
return TRUE;
} else if (g_str_equal (key, "Repeat")) {
if (mpris_controller_toggle (priv->mpris_controller, "LoopStatus"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]