]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Working for Realtime Audio Streams
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 30 Apr 2021 13:55:11 +0000 (14:55 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 30 Apr 2021 13:55:11 +0000 (14:55 +0100)
dacp.c
rtp.c
rtsp.c

diff --git a/dacp.c b/dacp.c
index 54d1e4c0f27a8db65913449c1e95842d9f46f7a1..906519fd7e2c63c7b1ec231c9f047a221ca442cf 100644 (file)
--- 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 6d4a0a5c0b8f3b5916970c36aac89e5a2f7bffeb..f0f90ed8146d6456c1a267995261e5bc88627e11 100644 (file)
--- 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 13364690cb2ffc8e4655ad33e5438371db68fa9b..8236765bd031e8a964c82362f9a57d20d01f1a87 100644 (file)
--- 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);
   }
 }