if (do_wait == 0)
if ((conn->ab_synced != 0) && (conn->ab_read == conn->ab_write)) { // the buffer is empty!
if (notified_buffer_empty == 0) {
- debug(1, "Buffers exhausted.");
+ debug(3, "Buffers exhausted.");
notified_buffer_empty = 1;
}
do_wait = 1;
pthread_kill(rtp_control_thread, SIGUSR1);
pthread_kill(rtp_timing_thread, SIGUSR1);
pthread_join(rtp_timing_thread, NULL);
- debug(1, "timing thread joined");
+ debug(3, "timing thread joined");
pthread_join(rtp_audio_thread, NULL);
- debug(1, "audio thread joined");
+ debug(3, "audio thread joined");
pthread_join(rtp_control_thread, NULL);
- debug(1, "control thread joined");
+ debug(3, "control thread joined");
clear_reference_timestamp(conn);
conn->rtp_running = 0;
free(conn->player_thread);
conn->player_thread = NULL;
} else {
- debug(1,"player thread of RTSP conversation %d is already deleted.",conn->connection_number);
+ debug(3,"player thread of RTSP conversation %d is already deleted.",conn->connection_number);
}
}
warn("Audio receiver -- Unknown RTP packet of type 0x%02X length %d.", type, nread);
}
- debug(1, "Audio receiver -- Server RTP thread interrupted. terminating.");
+ debug(3, "Audio receiver -- Server RTP thread interrupted. terminating.");
close(conn->audio_socket);
return NULL;
player_put_packet(seqno, timestamp, pktp, plen, conn);
continue;
} else {
- debug(1, "Too-short retransmitted audio packet received in control port, ignored.");
+ debug(3, "Too-short retransmitted audio packet received in control port, ignored.");
}
} else
- debug(1, "Control Port -- Unknown RTP packet of type 0x%02X length %d.", packet[1], nread);
+ debug(1, "Control Port -- Unknown RTP packet of type 0x%02X length %d, ignored.", packet[1], nread);
}
- debug(1, "Control RTP thread interrupted. terminating.");
+ debug(3, "Control RTP thread interrupted. terminating.");
close(conn->control_socket);
return NULL;
else
sleep(3);
}
- debug(1, "rtp_timing_sender thread interrupted. terminating.");
+ debug(3, "rtp_timing_sender thread interrupted. terminating.");
return NULL;
}
}
}
- debug(1, "Timing thread interrupted. terminating.");
+ debug(3, "Timing thread interrupted. terminating.");
conn->timing_sender_stop = 1;
void *retval;
pthread_kill(timer_requester, SIGUSR1);
- debug(1, "Wait for timer requester to exit.");
+ debug(3, "Wait for timer requester to exit.");
pthread_join(timer_requester, &retval);
- debug(1, "Closed and terminated timer requester thread.");
- debug(1, "Timing RTP thread terminated.");
+ debug(3, "Closed and terminated timer requester thread.");
+ debug(3, "Timing RTP thread terminated.");
close(conn->timing_socket);
return NULL;
// debug(2, "culling threads.");
for (i = 0; i < nconns;) {
if (conns[i]->running == 0) {
- debug(1, "found RTSP connection thread %d in a non-running state.",conns[i]->connection_number);
+ debug(3, "found RTSP connection thread %d in a non-running state.",conns[i]->connection_number);
pthread_join(conns[i]->thread, &retval);
- debug(1, "RTSP connection thread %d deleted...",conns[i]->connection_number);
+ debug(3, "RTSP connection thread %d deleted...",conns[i]->connection_number);
free(conns[i]);
nconns--;
if (nconns)
while (msg_size < 0) {
memory_barrier();
if (conn->stop != 0) {
- debug(1, "RTSP conversation thread %d shutdown requested.",conn->connection_number);
+ debug(3, "RTSP conversation thread %d shutdown requested.",conn->connection_number);
reply = rtsp_read_request_response_immediate_shutdown_requested;
goto shutdown;
}
if (nread == 0) {
// a blocking read that returns zero means eof -- implies connection closed
- debug(1, "RTSP conversation thread %d -- connection closed.",conn->connection_number);
+ debug(3, "RTSP conversation thread %d -- connection closed.",conn->connection_number);
reply = rtsp_read_request_response_channel_closed;
goto shutdown;
}
resp->respcode = 200;
msg_add_header(resp, "Connection", "close");
- debug(1, "TEARDOWN: synchronously terminating the player thread of RTSP conversation thread %d (2).",conn->connection_number);
+ debug(3, "TEARDOWN: synchronously terminating the player thread of RTSP conversation thread %d (2).",conn->connection_number);
//if (rtsp_playing()) {
player_stop(conn);
- debug(1, "TEARDOWN: successful termination of playing thread of RTSP conversation thread %d.",conn->connection_number);
+ debug(3, "TEARDOWN: successful termination of playing thread of RTSP conversation thread %d.",conn->connection_number);
//}
}
}
static void handle_announce(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
- debug(1,"Connection %d: ANNOUNCE",conn->connection_number);
+ debug(3,"Connection %d: ANNOUNCE",conn->connection_number);
int have_the_player = 0;
// interrupt session if permitted
have_the_player = 1;
} else {
if (playing_conn) {
- debug(1,"RTSP Conversation thread %d already playing.",playing_conn->connection_number);
+ debug(1,"RTSP Conversation thread %d already playing when asked by thread %d.",playing_conn->connection_number,conn->connection_number);
} else {
debug(1,"play_lock locked but no playing_conn.");
}
if (have_the_player) {
playing_conn = conn; // the present connection is now playing
- debug(1,"RTSP conversation thread %d has acquired play lock.",conn->connection_number);
+ debug(3,"RTSP conversation thread %d has acquired play lock.",conn->connection_number);
resp->respcode = 456; // 456 - Header Field Not Valid for Resource
char *paesiv = NULL;
char *prsaaeskey = NULL;
char *hdr = msg_get_header(req, "X-Apple-Client-Name");
if (hdr) {
- debug(1, "Play connection from device named \"%s\".", hdr);
+ debug(1, "Play connection from device named \"%s\" on RTSP conversation thread %d.", hdr,conn->connection_number);
#ifdef CONFIG_METADATA
send_metadata('ssnc', 'snam', hdr, strlen(hdr), req, 1);
#endif
}
hdr = msg_get_header(req, "User-Agent");
if (hdr) {
- debug(1, "Play connection from user agent \"%s\".", hdr);
+ debug(1, "Play connection from user agent \"%s\" on RTSP conversation thread %d.", hdr,conn->connection_number);
#ifdef CONFIG_METADATA
send_metadata('ssnc', 'snua', hdr, strlen(hdr), req, 1);
#endif
} else {
if ((reply==rtsp_read_request_response_immediate_shutdown_requested) ||
(reply==rtsp_read_request_response_channel_closed)) {
- debug(1, "Synchronously terminate playing thread of RTSP conversation thread %d.",conn->connection_number);
+ debug(3, "Synchronously terminate playing thread of RTSP conversation thread %d.",conn->connection_number);
player_stop(conn);
- debug(1, "Successful termination of playing thread of RTSP conversation thread %d.",conn->connection_number);
- debug(1, "Request termination of RTSP conversation thread %d.",conn->connection_number);
+ debug(3, "Successful termination of playing thread of RTSP conversation thread %d.",conn->connection_number);
+ debug(3, "Request termination of RTSP conversation thread %d.",conn->connection_number);
conn->stop = 1;
} else {
debug(1, "rtsp_read_request error %d, packet ignored.", (int)reply);
free(auth_nonce);
rtp_terminate(conn);
if (playing_conn==conn) {
- debug(1,"Unlocking play lock on RTSP conversation thread %d.",conn->connection_number);
+ debug(3,"Unlocking play lock on RTSP conversation thread %d.",conn->connection_number);
playing_conn = NULL;
pthread_mutex_unlock(&play_lock);
}
- debug(1, "RTSP conversation thread %d terminated.",conn->connection_number);
+ debug(3, "RTSP conversation thread %d terminated.",conn->connection_number);
// please_shutdown = 0;
conn->running = 0;
return NULL;
send_ssnc_metadata('clip', strdup(remote_ip4), strlen(remote_ip4), 1);
send_ssnc_metadata('svip', strdup(ip4), strlen(ip4), 1);
#endif
- debug(1, "New RTSP connection from %s:%u to self at %s:%u.", remote_ip4, rport, ip4,
- tport);
+ debug(1, "New RTSP connection from %s:%u to self at %s:%u on conversation thread %d.", remote_ip4, rport, ip4,
+ tport,conn->connection_number);
}
#ifdef AF_INET6
if (local_info->SAFAMILY == AF_INET6) {
send_ssnc_metadata('clip', strdup(remote_ip6), strlen(remote_ip6), 1);
send_ssnc_metadata('svip', strdup(ip6), strlen(ip6), 1);
#endif
- debug(1, "New RTSP connection from [%s]:%u to self at [%s]:%u.", remote_ip6, rport, ip6,
- tport);
+ debug(1, "New RTSP connection from [%s]:%u to self at [%s]:%u on conversation thread %d.", remote_ip6, rport, ip6,
+ tport,conn->connection_number);
}
#endif
conn); // also acts as a memory barrier
if (ret)
die("Failed to create RTSP receiver thread %d!",conn->connection_number);
- debug(1,"Successfully created RTSP receiver thread %d.",conn->connection_number);
+ debug(3,"Successfully created RTSP receiver thread %d.",conn->connection_number);
conn->running = 1; // this must happen before the thread is tracked
track_thread(conn);
}