]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Looks for min and max latencies, doesn't use them yet, has unnecessary code for detec...
authorMike Brady <mikebrady@eircom.net>
Mon, 8 Jan 2018 23:03:38 +0000 (23:03 +0000)
committerMike Brady <mikebrady@eircom.net>
Mon, 8 Jan 2018 23:03:38 +0000 (23:03 +0000)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index 7e816726712abd2d0f8d23cbae888ab6e10316cd..232a6d732fd020b4f080b90fa066825a5d43a43a 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -819,6 +819,9 @@ static void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *
             config.ForkedDaapdLatency);
       config.latency = config.ForkedDaapdLatency;
       conn->staticLatencyCorrection = 11025;
+    } else if (strstr(ua, "Airfoil") == ua) {
+      debug(2, "User-Agent is Airfoil");
+      conn->staticLatencyCorrection = 11025;
     } else {
       debug(2, "Unrecognised User-Agent. Using latency of %d frames.", config.latency);
     }
@@ -1509,6 +1512,8 @@ static void handle_announce(rtsp_conn_info *conn, rtsp_message *req, rtsp_messag
     char *paesiv = NULL;
     char *prsaaeskey = NULL;
     char *pfmtp = NULL;
+    char *pminlatency = NULL;
+    char *pmaxlatency = NULL;
     char *cp = req->content;
     int cp_left = req->contentlength;
     char *next;
@@ -1525,8 +1530,24 @@ static void handle_announce(rtsp_conn_info *conn, rtsp_message *req, rtsp_messag
       if (!strncmp(cp, "a=rsaaeskey:", 12))
         prsaaeskey = cp + 12;
 
+      if (!strncmp(cp, "a=min-latency:", 14))
+        pminlatency = cp + 14;
+
+      if (!strncmp(cp, "a=max-latency:", 14))
+        pmaxlatency = cp + 14;
+        
       cp = next;
     }
+    
+    if (pminlatency) {
+      int minl = atoi(pminlatency);
+      debug(1,"Minimum latency %d specified",minl);
+    }
+
+    if (pmaxlatency) {
+      int maxl = atoi(pmaxlatency);
+      debug(1,"Maximum latency %d specified",maxl);
+    }
 
     if ((paesiv == NULL) && (prsaaeskey == NULL)) {
       // debug(1,"Unencrypted session requested?");