Skip to content

Commit

Permalink
Quieten some debug messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Sep 29, 2021
1 parent 0fe21f3 commit 5c41870
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
6 changes: 3 additions & 3 deletions rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.");
}
Expand Down
31 changes: 12 additions & 19 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand All @@ -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);
}
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 5c41870

Please sign in to comment.