diff --git a/common.h b/common.h index ca156a53..772da08a 100644 --- a/common.h +++ b/common.h @@ -193,6 +193,8 @@ typedef struct { double resend_control_check_interval_time; // wait this long between making requests double resend_control_last_check_time; // if the packet is missing this close to the time of use, // give up + + int get_plist_metadata; // set to non-zero to get richer plist metadata pthread_mutex_t lock; config_t *cfg; int endianness; diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index acbb1ae9..62319ade 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -399,4 +399,5 @@ diagnostics = // log_show_time_since_last_message = "yes"; // set this to yes if you want the time since the last debug message in the debug message -- seconds down to nanoseconds // drop_this_fraction_of_audio_packets = 0.0; // use this to simulate a noisy network where this fraction of UDP packets are lost in transmission. E.g. a value of 0.001 would mean an average of 0.1% of packets are lost, which is actually quite a high figure. // retain_cover_art = "no"; // artwork is deleted when its corresponding track has been played. Set this to "yes" to retain all artwork permanently. Warning -- your directory might fill up. +// get_plist_metadata = "no"; // set this temporary setting to "yes" to get the new richer metadata stream. }; diff --git a/shairport.c b/shairport.c index 5f7831ca..0df27a45 100644 --- a/shairport.c +++ b/shairport.c @@ -773,6 +773,17 @@ int parse_options(int argc, char **argv) { "inclusive.", value); } + + if (config_lookup_string(config.cfg, "diagnostics.get_plist_metadata", &str)) { + if (strcasecmp(str, "no") == 0) + config.get_plist_metadata = 0; + else if (strcasecmp(str, "yes") == 0) + config.get_plist_metadata = 1; + else + die("Invalid \"get_plist_metadata\" option choice \"%s\". It should be \"yes\" or " + "\"no\"", + str); + } /* Get the verbosity setting. */ if (config_lookup_int(config.cfg, "diagnostics.log_verbosity", &value)) { @@ -1637,17 +1648,22 @@ int parse_options(int argc, char **argv) { // provides much more information, so should be the default for AirPlay 2 if (config.metadata_enabled != 0) { - config.airplay_features |= - (uint64_t)1 << 50; // metadata in a binary plist, including more state information - // config.airplay_features |= ((uint64_t)1 << 15) | ((uint64_t)1 << 16) | ((uint64_t)1 << 17); - // // older metadata flags artwork, progress and text respectively + if (config.get_plist_metadata != 0) { + config.airplay_features |= + (uint64_t)1 << 50; // richer metadata in a binary plist, including more state information + } else { + // older metadata flags artwork, progress and text respectively + config.airplay_features |= (((uint64_t)1 << 16) | ((uint64_t)1 << 17)); + if (config.get_coverart != 0) + config.airplay_features |= ((uint64_t)1 << 15); + } } #endif // now generate the fex field uint8_t fexbytes[8]; uint64_t temp = config.airplay_features; - debug(2, "airplay_features are %" PRIx64 ".", temp); + debug(1, "airplay_features are %" PRIx64 ".", temp); for (i = 0; i < 8; i++) { fexbytes[i] = temp & 0xff; temp = temp >> 8;