]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Open the SHM instrface atstartup and close it on shutdown.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 26 Feb 2022 08:27:45 +0000 (08:27 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 26 Feb 2022 08:27:45 +0000 (08:27 +0000)
shairport.c

index e9fdd8d2026d7a4677471ade016e61de635181d3..ea7b0b957c6aaf1b16380b3829cdd8111a68568e 100644 (file)
@@ -47,6 +47,7 @@
 #include <gcrypt.h>
 #include <sodium.h>
 #include <uuid/uuid.h>
+#include "ptp-utilities.h"
 #endif
 
 #ifdef CONFIG_MBEDTLS
@@ -1541,6 +1542,7 @@ void exit_function() {
         free(config.airplay_pin);
       if (config.airplay_pi)
         free(config.airplay_pi);
+      ptp_shm_interface_close(); // close it if it's open
 #endif
 
 #ifdef CONFIG_LIBDAEMON
@@ -2208,6 +2210,10 @@ int main(int argc, char **argv) {
   }
 #endif
 
+#ifdef CONFIG_AIRPLAY_2
+  ptp_shm_interface_open(); 
+#endif
+
   activity_monitor_start(); // not yet for AP2
   pthread_create(&rtsp_listener_thread, NULL, &rtsp_listen_loop, NULL);
   atexit(exit_rtsp_listener);