Skip to content

Commit

Permalink
Allow custom methods in Rtsp Options response public header
Browse files Browse the repository at this point in the history
ExoPlayer will not fail playback if an RTSP server responds to the Options request with an unknown RTSP method request type. ExoPlayer will parse the response and just not call methods it does not know how to use.

Issue: #613
PiperOrigin-RevId: 568152076
  • Loading branch information
microkatz authored and Copybara-Service committed Sep 25, 2023
1 parent 1f86a4e commit 916b4b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
* Check state in RTSP setup when returning loading state of
`RtspMediaPeriod`
([#577](https://github.com/androidx/media/issues/577)).
* Ignore custom Rtsp request methods in Options response public header
([#613](https://github.com/androidx/media/issues/613)).
* Decoder Extensions (FFmpeg, VP9, AV1, etc.):
* MIDI extension:
* Leanback extension:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ public static String toMethodString(@RtspRequest.Method int method) {
case "TEARDOWN":
return METHOD_TEARDOWN;
default:
throw new IllegalArgumentException();
// Return METHOD_UNSET for unknown Rtsp Request method.
return METHOD_UNSET;
}
}

Expand Down Expand Up @@ -388,7 +389,10 @@ public static ImmutableList<Integer> parsePublicHeader(@Nullable String publicHe

ImmutableList.Builder<Integer> methodListBuilder = new ImmutableList.Builder<>();
for (String method : Util.split(publicHeader, ",\\s?")) {
methodListBuilder.add(parseMethodString(method));
@RtspRequest.Method int rtspRequestMethod = parseMethodString(method);
if (rtspRequestMethod != METHOD_UNSET) {
methodListBuilder.add(rtspRequestMethod);
}
}
return methodListBuilder.build();
}
Expand Down

0 comments on commit 916b4b0

Please sign in to comment.