Add new metadata item: sps:songdatakind, derived from the asdk metadata token. It seems to indicate a timed item (0) or an untimed stream (1). Add output format, output frame rate, stream type (Realtime/Buffered/Classic) properties. Update MQTT appropriately.

This commit is contained in:
Mike Brady
2022-11-12 16:42:25 +00:00
parent b38a52b40b
commit d67909b837
9 changed files with 128 additions and 31 deletions
+2 -2
View File
@@ -174,7 +174,7 @@ void mpris_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)
}
// Add in the Track ID based on the 'mper' metadata if it is non-zero
if (argc->item_id != 0) {
if (argc->item_id_is_valid != 0) {
char trackidstring[128];
snprintf(trackidstring, sizeof(trackidstring), "/org/gnome/ShairportSync/%" PRIX64 "",
argc->item_id);
@@ -212,7 +212,7 @@ void mpris_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)
g_variant_builder_add(dict_builder, "{sv}", "xesam:genre", genre);
}
if (argc->songtime_in_milliseconds) {
if (argc->songtime_in_milliseconds_is_valid) {
uint64_t track_length_in_microseconds = argc->songtime_in_milliseconds;
track_length_in_microseconds *= 1000; // to microseconds in 64-bit precision
// Make up the track name and album name