Commit 24b2c092 by andrewlewis Committed by Oliver Woodman

Use longs rather than ints for HLS byterange.

Issue: #1387
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118024270
parent 454b3e89
......@@ -36,12 +36,12 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
public final boolean isEncrypted;
public final String encryptionKeyUri;
public final String encryptionIV;
public final int byterangeOffset;
public final int byterangeLength;
public final long byterangeOffset;
public final long byterangeLength;
public Segment(String uri, double durationSecs, int discontinuitySequenceNumber,
long startTimeUs, boolean isEncrypted, String encryptionKeyUri, String encryptionIV,
int byterangeOffset, int byterangeLength) {
long byterangeOffset, long byterangeLength) {
this.url = uri;
this.durationSecs = durationSecs;
this.discontinuitySequenceNumber = discontinuitySequenceNumber;
......
......@@ -244,8 +244,8 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
double segmentDurationSecs = 0.0;
int discontinuitySequenceNumber = 0;
long segmentStartTimeUs = 0;
int segmentByterangeOffset = 0;
int segmentByterangeLength = C.LENGTH_UNBOUNDED;
long segmentByterangeOffset = 0;
long segmentByterangeLength = C.LENGTH_UNBOUNDED;
int segmentMediaSequence = 0;
boolean isEncrypted = false;
......@@ -279,9 +279,9 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
} else if (line.startsWith(BYTERANGE_TAG)) {
String byteRange = HlsParserUtil.parseStringAttr(line, BYTERANGE_REGEX, BYTERANGE_TAG);
String[] splitByteRange = byteRange.split("@");
segmentByterangeLength = Integer.parseInt(splitByteRange[0]);
segmentByterangeLength = Long.parseLong(splitByteRange[0]);
if (splitByteRange.length > 1) {
segmentByterangeOffset = Integer.parseInt(splitByteRange[1]);
segmentByterangeOffset = Long.parseLong(splitByteRange[1]);
}
} else if (line.startsWith(DISCONTINUITY_SEQUENCE_TAG)) {
discontinuitySequenceNumber = Integer.parseInt(line.substring(line.indexOf(':') + 1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment