Skip to content

Commit

Permalink
Looks for min and max latencies, doesn't use them yet, has unnecessar…
Browse files Browse the repository at this point in the history
…y code for detecting Airfoil
  • Loading branch information
mikebrady committed Jan 8, 2018
1 parent b67718a commit 728abe8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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?");
Expand Down

0 comments on commit 728abe8

Please sign in to comment.