Allow custom methods in Rtsp Options response public header

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: androidx/media#613
PiperOrigin-RevId: 568152076
This commit is contained in:
michaelkatz 2023-09-25 02:13:05 -07:00 committed by Copybara-Service
parent 1f86a4e48d
commit 916b4b0ad7
2 changed files with 8 additions and 2 deletions

View File

@ -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:

View File

@ -285,7 +285,8 @@ import java.util.regex.Pattern;
case "TEARDOWN":
return METHOD_TEARDOWN;
default:
throw new IllegalArgumentException();
// Return METHOD_UNSET for unknown Rtsp Request method.
return METHOD_UNSET;
}
}
@ -388,7 +389,10 @@ import java.util.regex.Pattern;
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();
}