summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-11-16 13:36:48 +0100
committerBastien Nocera <hadess@hadess.net>2022-11-16 13:36:48 +0100
commit56906a95ccc8811901fa304ad87d320aab7d93ac (patch)
tree344a4db6a04febefb2e616cf5414e2a9ecfa0714
parentcfe579a725a98d242637f7a0d59f8f3edf9a8462 (diff)
downloadtotem-56906a95ccc8811901fa304ad87d320aab7d93ac.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;