config.output->stop();
debug(2, "Cancelling timing, control and audio threads...");
+ debug(2, "Cancel timing thread.");
pthread_cancel(rtp_timing_thread);
- pthread_cancel(rtp_control_thread);
- pthread_cancel(rtp_audio_thread);
- debug(2, "Joining terminated threads.");
+ debug(2, "Join timing thread.");
pthread_join(rtp_timing_thread, NULL);
debug(2, "Timing thread terminated.");
+ debug(2, "Cancel control thread.");
+ pthread_cancel(rtp_control_thread);
+ debug(2, "Join control thread.");
pthread_join(rtp_control_thread, NULL);
debug(2, "Control thread terminated.");
+ debug(2, "Cancel audio thread.");
+ pthread_cancel(rtp_audio_thread);
+ debug(2, "Join audio thread.");
pthread_join(rtp_audio_thread, NULL);
debug(2, "Audio thread terminated.");
clear_reference_timestamp(conn);
void rtp_audio_receiver_cleanup_handler(void *arg) {
debug(3, "Audio Receiver Cleanup.");
rtsp_conn_info *conn = (rtsp_conn_info *)arg;
+ debug(1,"shutdown audio socket.");
+ shutdown(conn->audio_socket,SHUT_RDWR);
+ debug(1,"close audio socket.");
close(conn->audio_socket);
debug(3, "Audio Receiver Cleanup Successful.");
}
void rtp_control_handler_cleanup_handler(void *arg) {
debug(3, "Control Receiver Cleanup.");
rtsp_conn_info *conn = (rtsp_conn_info *)arg;
+ debug(1,"shutdown control socket.");
+ shutdown(conn->control_socket,SHUT_RDWR);
+ debug(1,"close control socket.");
close(conn->control_socket);
debug(3, "Control Receiver Cleanup Successful.");
}
rtsp_conn_info *conn = (rtsp_conn_info *)arg;
pthread_cancel(conn->timer_requester);
pthread_join(conn->timer_requester, NULL);
+ debug(1,"shutdown timing socket.");
+ shutdown(conn->timing_socket,SHUT_RDWR);
+ debug(1,"close timing socket.");
close(conn->timing_socket);
debug(3, "Timing Receiver Cleanup Successful.");
}