]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Quieten some debug messages.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 29 Sep 2021 09:08:22 +0000 (10:08 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 29 Sep 2021 09:08:22 +0000 (10:08 +0100)
rtp.c
rtsp.c

diff --git a/rtp.c b/rtp.c
index 867923691d2035c37161fccdc59d0972d1629311..db8ff2f0308404fe9176e74c9b2deaeeb6209ecf 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -1564,7 +1564,7 @@ void rtp_ap2_control_handler_cleanup_handler(void *arg) {
   rtsp_conn_info *conn = (rtsp_conn_info *)arg;
   debug(2, "Connection %d: AP2 Control Receiver Cleanup.", conn->connection_number);
   close(conn->ap2_control_socket);
-          debug(1, "Connection %d: UDP control port %u closed.", conn->connection_number, conn->local_ap2_control_port);
+  debug(2, "Connection %d: UDP control port %u closed.", conn->connection_number, conn->local_ap2_control_port);
   conn->ap2_control_socket = 0;
   conn->ap2_remote_control_socket_addr_length =
       0; // indicates to the control receiver thread that the socket address need to be
@@ -1749,7 +1749,7 @@ void *rtp_ap2_control_receiver(void *arg) {
 
 void rtp_realtime_audio_cleanup_handler(__attribute__((unused)) void *arg) {
   debug(2, "Realtime Audio Receiver Cleanup Start.");
-  rtsp_conn_info *conn = (rtsp_conn_info *)arg;  
+  rtsp_conn_info *conn = (rtsp_conn_info *)arg;
   close(conn->realtime_audio_socket);
   debug(1, "Connection %d: closing realtime audio port %u", conn->local_realtime_audio_port);
   conn->realtime_audio_socket = 0;
@@ -2030,7 +2030,7 @@ void rtp_buffered_audio_cleanup_handler(__attribute__((unused)) void *arg) {
   debug(2, "Buffered Audio Receiver Cleanup Start.");
   rtsp_conn_info *conn = (rtsp_conn_info *)arg;
   close(conn->buffered_audio_socket);
-  debug(1, "Connection %d: TCP Buffered Audio port closed: %u.", conn->connection_number, conn->local_buffered_audio_port);
+  debug(2, "Connection %d: TCP Buffered Audio port closed: %u.", conn->connection_number, conn->local_buffered_audio_port);
   conn->buffered_audio_socket = 0;
   debug(2, "Buffered Audio Receiver Cleanup Done.");
 }
diff --git a/rtsp.c b/rtsp.c
index 85ec6692e5c1f1ad6ac5ce4814160d13b3a7a186..56ac5b3c9cd2d3aed88eecc51fa181b2dca26550 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -686,7 +686,7 @@ void cleanup_threads(void) {
       debug(3, "found RTSP connection thread %d in a non-running state.",
             conns[i]->connection_number);
       pthread_join(conns[i]->thread, &retval);
-      debug(1, "Connection %d: deleted in cleanup.", conns[i]->connection_number);
+      debug(2, "Connection %d: deleted in cleanup.", conns[i]->connection_number);
       free(conns[i]);
       conns[i] = NULL;
     }
@@ -2322,7 +2322,7 @@ void teardown_phase_two(rtsp_conn_info *conn) {
   // we are being asked to disconnect
   // this can be called more than once on the same connection --
   // by the player itself but also by the play seesion being killed
-  debug(1, "Connection %d: TEARDOWN a %s connection.", conn->connection_number,
+  debug(2, "Connection %d: TEARDOWN a %s connection.", conn->connection_number,
         get_category_string(conn->airplay_stream_category));
   if (conn->rtp_event_thread) {
     debug(2, "Connection %d: TEARDOWN Delete Event Thread.", conn->connection_number);
@@ -2331,11 +2331,11 @@ void teardown_phase_two(rtsp_conn_info *conn) {
     free(conn->rtp_event_thread);
     conn->rtp_event_thread = NULL;
   }
-  debug(1, "Connection %d: TEARDOWN Close Event Socket.", conn->connection_number);
+  debug(2, "Connection %d: TEARDOWN Close Event Socket.", conn->connection_number);
   if (conn->event_socket) {
     close(conn->event_socket);
     conn->event_socket = 0;
-    debug(1, "Connection %d: closing TCP event port %u.", conn->connection_number, conn->local_event_port);
+    debug(2, "Connection %d: closing TCP event port %u.", conn->connection_number, conn->local_event_port);
   }
 
   // if we are closing a PTP stream only, do this
@@ -2347,7 +2347,7 @@ void teardown_phase_two(rtsp_conn_info *conn) {
     conn->groupContainsGroupLeader = 0;
     config.airplay_statusflags &= (0xffffffff - (1 << 11)); // DeviceSupportsRelay
     build_bonjour_strings(conn);
-    debug(1, "Connection %d: TEARDOWN mdns_update on %s.", conn->connection_number,
+    debug(2, "Connection %d: TEARDOWN mdns_update on %s.", conn->connection_number,
           get_category_string(conn->airplay_stream_category));
     mdns_update(NULL, secondary_txt_records);
   }
@@ -2368,7 +2368,7 @@ void handle_teardown_2(rtsp_conn_info *conn, __attribute__((unused)) rtsp_messag
     plist_t streams = plist_dict_get_item(messagePlist, "streams");
 
     if (streams) {
-      debug(1, "Connection %d: TEARDOWN a %s.", conn->connection_number,
+      debug(2, "Connection %d: TEARDOWN a %s.", conn->connection_number,
             get_category_string(conn->airplay_stream_category));
       // we are being asked to close a stream
       teardown_phase_one(conn);
@@ -3633,7 +3633,6 @@ void *metadata_mqtt_thread_function(__attribute__((unused)) void *ignore) {
 #endif
 
 void metadata_init(void) {
-  int ret;
   if (config.metadata_enabled) {
     // create the metadata pipe, if necessary
     size_t pl = strlen(config.metadata_pipename) + 1;
@@ -3659,24 +3658,18 @@ void metadata_init(void) {
            (char *)errorstring, path);
     }
     free(path);
-    int ret;
-    ret = pthread_create(&metadata_thread, NULL, metadata_thread_function, NULL);
-    if (ret)
+    if (pthread_create(&metadata_thread, NULL, metadata_thread_function, NULL) != 0)
       debug(1, "Failed to create metadata thread!");
 
-    ret =
-        pthread_create(&metadata_multicast_thread, NULL, metadata_multicast_thread_function, NULL);
-    if (ret)
+    if (pthread_create(&metadata_multicast_thread, NULL, metadata_multicast_thread_function, NULL) != 0)
       debug(1, "Failed to create metadata multicast thread!");
   }
 #ifdef CONFIG_METADATA_HUB
-  ret = pthread_create(&metadata_hub_thread, NULL, metadata_hub_thread_function, NULL);
-  if (ret)
+  if (pthread_create(&metadata_hub_thread, NULL, metadata_hub_thread_function, NULL) != 0)
     debug(1, "Failed to create metadata hub thread!");
 #endif
 #ifdef CONFIG_MQTT
-  ret = pthread_create(&metadata_mqtt_thread, NULL, metadata_mqtt_thread_function, NULL);
-  if (ret)
+  if (pthread_create(&metadata_mqtt_thread, NULL, metadata_mqtt_thread_function, NULL) != 0)
     debug(1, "Failed to create metadata mqtt thread!");
 #endif
   metadata_running = 1;
@@ -4488,7 +4481,7 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
   int oldState;
   pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
 
-  debug(1, "Connection %d: rtsp_conversation_thread_func_cleanup_function called.",
+  debug(2, "Connection %d: rtsp_conversation_thread_func_cleanup_function called.",
         conn->connection_number);
 #ifdef CONFIG_AIRPLAY_2
   teardown_phase_one(conn);
@@ -4514,7 +4507,7 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
     close(conn->fd);
     debug(3, "Connection %d terminating: closed fd %d.", conn->connection_number, conn->fd);
 
-    debug(1, "Connection %d: terminating connection from %s:%u to self at %s:%u.",
+    debug(2, "Connection %d: terminating connection from %s:%u to self at %s:%u.",
           conn->connection_number, conn->client_ip_string, conn->client_rtsp_port,
           conn->self_ip_string, conn->self_rtsp_port);
   }