Bugfix -- don't try to create the metadata pipe or output metadata to it when metadata has not been enabled.

This commit is contained in:
Mike Brady
2020-12-05 18:00:47 +00:00
parent 02cd3f8fdb
commit 5146efd768
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -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);
+4 -2
View File
@@ -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