From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 30 Apr 2021 13:55:11 +0000 (+0100) Subject: Working for Realtime Audio Streams X-Git-Tag: 4.0-dev~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91b85a020714f74bd2a3363c7309cfbd39f101b7;p=thirdparty%2Fshairport-sync.git Working for Realtime Audio Streams --- diff --git a/dacp.c b/dacp.c index 54d1e4c0..906519fd 100644 --- a/dacp.c +++ b/dacp.c @@ -415,10 +415,12 @@ void set_dacp_server_information(rtsp_conn_info *conn) { // This is different to other AirPlay clients // which return immediately with a 403 code if there are no changes. dacp_server.always_use_revision_number_1 = 0; - char *p = strstr(conn->UserAgent, "forked-daapd"); - if ((p != 0) && - (p == conn->UserAgent)) { // must exist and be at the start of the UserAgent string - dacp_server.always_use_revision_number_1 = 1; + if (conn->UserAgent != NULL) { + char *p = strstr(conn->UserAgent, "forked-daapd"); + if ((p != 0) && + (p == conn->UserAgent)) { // must exist and be at the start of the UserAgent string + dacp_server.always_use_revision_number_1 = 1; + } } metadata_hub_modify_prolog(); diff --git a/rtp.c b/rtp.c index 6d4a0a5c..f0f90ed8 100644 --- a/rtp.c +++ b/rtp.c @@ -1007,10 +1007,6 @@ void reset_ntp_anchor_info(rtsp_conn_info *conn) { debug_mutex_unlock(&conn->reference_time_mutex, 3); } -void reset_anchor_info(rtsp_conn_info *conn) { - reset_ntp_anchor_info(conn); -} - int have_ntp_timestamp_timing_information(rtsp_conn_info *conn) { if (conn->anchor_rtptime == 0) return 0; @@ -1018,10 +1014,6 @@ int have_ntp_timestamp_timing_information(rtsp_conn_info *conn) { return 1; } -int have_timestamp_timing_information(rtsp_conn_info *conn) { - return have_ntp_timestamp_timing_information(conn); -} - // set this to zero to use the rates supplied by the sources, which might not always be completely // right... const int use_nominal_rate = 0; // specify whether to use the nominal input rate, usually 44100 fps @@ -1196,14 +1188,6 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) { } } -int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) { - return frame_to_ntp_local_time(timestamp, time, conn); -} - -int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) { - return local_ntp_time_to_frame(time, frame, conn); -} - #ifdef CONFIG_AIRPLAY_2 void set_ptp_anchor_info(rtsp_conn_info *conn, uint64_t clock_id, uint32_t rtptime, @@ -2360,5 +2344,38 @@ void *rtp_buffered_audio_processor(void *arg) { pthread_cleanup_pop(1); // do the cleanup. pthread_exit(NULL); } +int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) { + return frame_to_ptp_local_time(timestamp, time, conn); +} +int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) { + return local_ptp_time_to_frame(time, frame, conn); +} + +void reset_anchor_info(rtsp_conn_info *conn) { + reset_ptp_anchor_info(conn); +} + +int have_timestamp_timing_information(rtsp_conn_info *conn) { + return have_ptp_timing_information(conn); +} + +#else +int frame_to_local_time(uint32_t timestamp, uint64_t *time, rtsp_conn_info *conn) { + return frame_to_ntp_local_time(timestamp, time, conn); +} + +int local_time_to_frame(uint64_t time, uint32_t *frame, rtsp_conn_info *conn) { + return local_ntp_time_to_frame(time, frame, conn); +} + +void reset_anchor_info(rtsp_conn_info *conn) { + reset_ntp_anchor_info(conn); +} + +int have_timestamp_timing_information(rtsp_conn_info *conn) { + return have_ntp_timestamp_timing_information(conn); +} #endif + + diff --git a/rtsp.c b/rtsp.c index 13364690..8236765b 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2016,10 +2016,10 @@ void handle_post(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) { } else if (strcmp(req->path, "/fp-setup") == 0) { handle_fp_setup(conn, req, resp); } else { - debug(2, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path, + debug(3, "Connection %d: POST %s Content-Length %d", conn->connection_number, req->path, req->contentlength); debug_log_rtsp_message(2, "POST request", req); - debug(2, "Unhandled POST, path \"%s\".", req->path); + debug(3, "Unhandled POST, path \"%s\".", req->path); } }