1
0
Fork 0
mirror of https://gitlab.postmarketos.org/postmarketOS/pmaports.git synced 2025-07-24 23:35:12 +03:00
pmaports/extra-repos/systemd/phosh/media-player.patch
2025-06-12 22:55:08 +02:00

73 lines
2.3 KiB
Diff

Patch-Source: https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1728
---
From 2f70c2272c3d77bbe8141fd468852f7f6caabe4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 2 Jun 2025 14:16:01 +0200
Subject: [PATCH 1/2] media-player: Don't forget to init cancellable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise cancelling will have no effect and we might end up accessing
free'd memory.
Fixes 2ca148785 ("media-player: Use MPRIS manager")
Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1234
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1726>
(cherry picked from commit f9d7d6851570845633ea91f3bdcb8dcdfb49259e)
---
src/media-player.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/media-player.c b/src/media-player.c
index 6ecb88c38..a66b9d0cb 100644
--- a/src/media-player.c
+++ b/src/media-player.c
@@ -796,6 +796,7 @@ phosh_media_player_init (PhoshMediaPlayer *self)
gtk_widget_init_template (GTK_WIDGET (self));
+ self->cancel = g_cancellable_new ();
self->track_length = -1;
self->track_position = -1;
self->pos_poller_id = 0;
--
GitLab
From 7b1dfcf1ecf015fb4dc7eeda7fc09a72e1d8472c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Wed, 4 Jun 2025 22:39:03 +0200
Subject: [PATCH 2/2] media-player: Init fetch icon cancellable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes f287f5deb ("media-player: Fetch cover art via http")
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1726>
(cherry picked from commit 568ba3f84cd75d6054e2b8764f47e35adf2aaf23)
---
src/media-player.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/media-player.c b/src/media-player.c
index a66b9d0cb..554d5586f 100644
--- a/src/media-player.c
+++ b/src/media-player.c
@@ -446,6 +446,9 @@ fetch_icon_async (PhoshMediaPlayer *self, const char *url)
g_debug ("Fetching icon for %s", url);
+ if (!self->fetch_icon_cancel)
+ self->fetch_icon_cancel = g_cancellable_new ();
+
icon = g_file_icon_new (file);
g_loadable_icon_load_async (G_LOADABLE_ICON (icon),
ART_PIXEL_SIZE,
--
GitLab