Skip to content

Commit

Permalink
The 'client_port' parameter's range specification (i.e RTCP port part…
Browse files Browse the repository at this point in the history
…) is optional in RtspServer

* If not specified then use the specified RTP port + 1.
  • Loading branch information
CORE Kien committed Apr 17, 2018
1 parent 89e0382 commit 1d7af23
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 1d7af23

Please sign in to comment.