mirror of
https://github.com/androidx/media.git
synced 2025-05-08 16:10:38 +08:00
Relax session timing requirement.
Some RTSP servers do not include the RANGE attribute for live contents. #minor-release PiperOrigin-RevId: 370662587
This commit is contained in:
parent
bf04bb5bc0
commit
13a34b8b4a
@ -443,12 +443,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
}
|
||||
|
||||
public void onDescribeResponseReceived(RtspDescribeResponse response) {
|
||||
@Nullable
|
||||
String sessionRangeAttributeString =
|
||||
checkNotNull(response.sessionDescription.attributes.get(SessionDescription.ATTR_RANGE));
|
||||
response.sessionDescription.attributes.get(SessionDescription.ATTR_RANGE);
|
||||
|
||||
try {
|
||||
sessionInfoListener.onSessionTimelineUpdated(
|
||||
RtspSessionTiming.parseTiming(sessionRangeAttributeString),
|
||||
sessionRangeAttributeString != null
|
||||
? RtspSessionTiming.parseTiming(sessionRangeAttributeString)
|
||||
: RtspSessionTiming.DEFAULT,
|
||||
buildTrackList(response.sessionDescription, uri));
|
||||
hasUpdatedTimelineAndTracks = true;
|
||||
} catch (ParserException e) {
|
||||
|
@ -31,7 +31,7 @@ import java.util.regex.Pattern;
|
||||
* <p>Currently only NPT is supported. See RFC2326 Section 3.6 for detail of NPT.
|
||||
*/
|
||||
public final class RtspSessionTiming {
|
||||
/** The default session timing starting from 0.000 and indefinite length. */
|
||||
/** The default session timing starting from 0.000 and indefinite length, effectively live. */
|
||||
public static final RtspSessionTiming DEFAULT =
|
||||
new RtspSessionTiming(/* startTimeMs= */ 0, /* stopTimeMs= */ C.TIME_UNSET);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user