From: Mike Brady Date: Fri, 18 May 2018 09:08:01 +0000 (+0100) Subject: Tidy up and quieten some debug messages. X-Git-Tag: 3.2RC8~2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=499fae9796f13017dc97a625bd1db087bb44fe83;p=thirdparty%2Fshairport-sync.git Tidy up and quieten some debug messages. --- diff --git a/rtp.c b/rtp.c index d7ad617f..d0f1d1af 100644 --- a/rtp.c +++ b/rtp.c @@ -66,10 +66,10 @@ void rtp_terminate(rtsp_conn_info *conn) { } void rtp_audio_receiver_cleanup_handler(void *arg) { - debug(2, "Audio Receiver Cleanup."); + debug(3, "Audio Receiver Cleanup."); rtsp_conn_info *conn = (rtsp_conn_info *)arg; close(conn->audio_socket); - debug(2, "Audio Receiver Cleanup Successful."); + debug(3, "Audio Receiver Cleanup Successful."); } void *rtp_audio_receiver(void *arg) { @@ -186,10 +186,10 @@ void *rtp_audio_receiver(void *arg) { } void rtp_control_handler_cleanup_handler(void *arg) { - debug(2, "Control Receiver Cleanup."); + debug(3, "Control Receiver Cleanup."); rtsp_conn_info *conn = (rtsp_conn_info *)arg; close(conn->control_socket); - debug(2, "Control Receiver Cleanup Successful."); + debug(3, "Control Receiver Cleanup Successful."); } void *rtp_control_receiver(void *arg) { @@ -462,17 +462,17 @@ void *rtp_timing_sender(void *arg) { else usleep(3000000); } - debug(3, "rtp_timing_sender thread interrupted. terminating."); + debug(3, "rtp_timing_sender thread interrupted. This should never happen."); pthread_exit(NULL); } void rtp_timing_receiver_cleanup_handler(void *arg) { - debug(2, "Timing Receiver Cleanup."); + debug(3, "Timing Receiver Cleanup."); rtsp_conn_info *conn = (rtsp_conn_info *)arg; pthread_cancel(conn->timer_requester); pthread_join(conn->timer_requester, NULL); close(conn->timing_socket); - debug(2, "Timing Receiver Cleanup Successful."); + debug(3, "Timing Receiver Cleanup Successful."); } void *rtp_timing_receiver(void *arg) { @@ -812,8 +812,8 @@ void rtp_setup(SOCKADDR *local, SOCKADDR *remote, uint16_t cport, uint16_t tport inet_ntop(conn->connection_ip_family, self_addr, conn->self_ip_string, sizeof(conn->self_ip_string)); - debug(2, "SETUP connection from %s to self at %s on RTSP conversation thread %d.", - conn->client_ip_string, conn->self_ip_string, conn->connection_number); + debug(2, "Connection %d: SETUP -- Connection from %s to self at %s.", + conn->connection_number,conn->client_ip_string, conn->self_ip_string); // set up a the record of the remote's control socket struct addrinfo hints; diff --git a/rtsp.c b/rtsp.c index 8366069c..a0e79118 100644 --- a/rtsp.c +++ b/rtsp.c @@ -762,12 +762,12 @@ static void handle_flush(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * } static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) { - debug(2, "Connection %d: SETUP", conn->connection_number); + debug(3, "Connection %d: SETUP", conn->connection_number); uint16_t cport, tport; char *ar = msg_get_header(req, "Active-Remote"); if (ar) { - debug(2, "Active-Remote string seen: \"%s\".", ar); + debug(2, "Connection %d: SETUP -- Active-Remote string seen: \"%s\".", conn->connection_number, ar); // get the active remote char *p; conn->dacp_active_remote = strtoul(ar, &p, 10); @@ -775,13 +775,13 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * send_metadata('ssnc', 'acre', ar, strlen(ar), req, 1); #endif } else { - debug(2, "Note: no Active-Remote information the SETUP Record."); + debug(2, "Connection %d: SETUP -- Note: no Active-Remote information the SETUP Record.",conn->connection_number); conn->dacp_active_remote = 0; } ar = msg_get_header(req, "DACP-ID"); if (ar) { - debug(2, "DACP-ID string seen: \"%s\".", ar); + debug(2, "Connection %d: SETUP -- DACP-ID string seen: \"%s\".",conn->connection_number, ar); if (conn->dacp_id) // this is in case SETUP was previously called free(conn->dacp_id); conn->dacp_id = strdup(ar); @@ -789,7 +789,7 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * send_metadata('ssnc', 'daid', ar, strlen(ar), req, 1); #endif } else { - debug(2, "Note: no DACP-ID string information in the SETUP Record."); + debug(2, "Connection %d: SETUP doesn't include DACP-ID string information.",conn->connection_number); if (conn->dacp_id) // this is in case SETUP was previously called free(conn->dacp_id); conn->dacp_id = NULL; @@ -797,14 +797,14 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * char *hdr = msg_get_header(req, "Transport"); if (!hdr) { - debug(1, "SETUP doesn't contain a Transport header."); + debug(1, "Connection %d: SETUP doesn't contain a Transport header.",conn->connection_number); goto error; } char *p; p = strstr(hdr, "control_port="); if (!p) { - debug(1, "SETUP doesn't specify a control_port."); + debug(1, "Connection %d: SETUP doesn't specify a control_port.",conn->connection_number); goto error; } p = strchr(p, '=') + 1; @@ -812,7 +812,7 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * p = strstr(hdr, "timing_port="); if (!p) { - debug(1, "SETUP doesn't specify a timing_port."); + debug(1, "Connection %d: SETUP doesn't specify a timing_port.",conn->connection_number); goto error; } p = strchr(p, '=') + 1; @@ -820,19 +820,19 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * if (conn->rtp_running) { if ((conn->remote_control_port != cport) || (conn->remote_timing_port != tport)) { - warn("Duplicate SETUP message with different control (old %u, new %u) or timing (old %u, new " - "%u) ports! This is probably fatal!", + warn("Connection %d: Duplicate SETUP message with different control (old %u, new %u) or timing (old %u, new " + "%u) ports! This is probably fatal!",conn->connection_number, conn->remote_control_port, cport, conn->remote_timing_port, tport); } else { - warn("Duplicate SETUP message with the same control (%u) and timing (%u) ports. This is " - "probably not fatal.", + warn("Connection %d: Duplicate SETUP message with the same control (%u) and timing (%u) ports. This is " + "probably not fatal.",conn->connection_number, conn->remote_control_port, conn->remote_timing_port); } } else { rtp_setup(&conn->local, &conn->remote, cport, tport, conn); } if (conn->local_audio_port == 0) { - debug(1, "SETUP seems to specify a null audio port."); + debug(1, "Connection %d: SETUP seems to specify a null audio port.",conn->connection_number); goto error; } @@ -851,7 +851,7 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message * return; error: - warn("Error in setup request -- unlocking play lock on RTSP conversation thread %d.", + warn("Connection %d: SETUP -- Error in setup request -- unlocking play lock.", conn->connection_number); playing_conn = NULL; pthread_mutex_unlock(&play_lock);