Skip to content

Commit

Permalink
Merge pull request #276 from KentVu/pr_prepare
Browse files Browse the repository at this point in the history
FIX an issue about the 'client_port' parameter in RtspServer
  • Loading branch information
Simon authored Feb 8, 2019
2 parents e71b49c + 0c2078d commit 3a78d22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ else if (request.method.equalsIgnoreCase("SETUP")) {
return response;
}

p = Pattern.compile("client_port=(\\d+)-(\\d+)", Pattern.CASE_INSENSITIVE);
p = Pattern.compile("client_port=(\\d+)(?:-(\\d+))?", Pattern.CASE_INSENSITIVE);
m = p.matcher(request.headers.get("transport"));

if (!m.find()) {
Expand All @@ -514,7 +514,11 @@ else if (request.method.equalsIgnoreCase("SETUP")) {
p2 = ports[1];
} else {
p1 = Integer.parseInt(m.group(1));
p2 = Integer.parseInt(m.group(2));
if (m.group(2) == null) {
p2 = p1+1;
} else {
p2 = Integer.parseInt(m.group(2));
}
}

ssrc = mSession.getTrack(trackId).getSSRC();
Expand Down

0 comments on commit 3a78d22

Please sign in to comment.