From 5146efd768a00b7d084cf1e80f3de51c584cadd3 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 5 Dec 2020 18:00:47 +0000 Subject: [PATCH] Bugfix -- don't try to create the metadata pipe or output metadata to it when metadata has not been enabled. --- rtsp.c | 3 ++- shairport.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rtsp.c b/rtsp.c index abfabc4f..184b411e 100644 --- a/rtsp.c +++ b/rtsp.c @@ -1793,7 +1793,8 @@ int send_metadata_to_queue(pc_queue *queue, uint32_t type, uint32_t code, char * int send_metadata(uint32_t type, uint32_t code, char *data, uint32_t length, rtsp_message *carrier, int block) { int rc; - rc = send_metadata_to_queue(&metadata_queue, type, code, data, length, carrier, block); + if (config.metadata_enabled) + rc = send_metadata_to_queue(&metadata_queue, type, code, data, length, carrier, block); #ifdef CONFIG_METADATA_HUB rc = send_metadata_to_queue(&metadata_hub_queue, type, code, data, length, carrier, block); diff --git a/shairport.c b/shairport.c index ba995233..9cedc72d 100644 --- a/shairport.c +++ b/shairport.c @@ -1362,7 +1362,8 @@ void exit_function() { #endif #ifdef CONFIG_METADATA - metadata_stop(); // close down the metadata pipe + if (config.metadata_enabled) + metadata_stop(); // close down the metadata pipe #endif activity_monitor_stop(0); @@ -1952,7 +1953,8 @@ int main(int argc, char **argv) { #endif memcpy(config.hw_addr, ap_md5, sizeof(config.hw_addr)); #ifdef CONFIG_METADATA - metadata_init(); // create the metadata pipe if necessary + if (config.metadata_enabled) + metadata_init(); // create the metadata pipe if necessary #endif #ifdef CONFIG_METADATA_HUB