summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-11-16 13:36:48 +0100
committerBastien Nocera <hadess@hadess.net>2023-02-13 14:58:32 +0100
commit8cd50878f6168d556b006645038544c4f38061da (patch)
treebbd0f47a15343e8f427bc6c21ef2eaadc00576da
parent24bd8a688f04cb65e7bb37f0fcbae785594cc19b (diff)
downloadtotem-8cd50878f6168d556b006645038544c4f38061da.tar.gz
mpris: Work-around some players not handling empty TrackId
It's unclear what to pass to the SetPosition() method when the application doesn't implement the TrackList interface and so doesn't have TrackId metadata. Export placeholder "/org/mpris/MediaPlayer2/TrackList/NoTrack" in the meanwhile, which we'll ignore in when SetPosition() is called. See https://gitlab.freedesktop.org/mpris/mpris-spec/-/issues/19 Closes: #538
-rw-r--r--src/plugins/mpris/totem-mpris.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/mpris/totem-mpris.c b/src/plugins/mpris/totem-mpris.c
index df9396bb1..77e0f8feb 100644
--- a/src/plugins/mpris/totem-mpris.c
+++ b/src/plugins/mpris/totem-mpris.c
@@ -277,6 +277,11 @@ calculate_metadata (TotemMprisPlugin *pi,
"{sv}",
"xesam:trackNumber",
g_variant_new_uint32 (pi->track_number));
+ /* See https://gitlab.freedesktop.org/mpris/mpris-spec/-/issues/19 */
+ g_variant_builder_add (builder,
+ "{sv}",
+ "mpris:trackid",
+ g_variant_new_object_path ("/org/mpris/MediaPlayer2/TrackList/NoTrack"));
for (i = 0; i < G_N_ELEMENTS (str_metadata); i++) {
const char *str;