mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Use longs rather than ints for HLS byterange.
Issue: #1387 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=118024270
This commit is contained in:
parent
454b3e896c
commit
24b2c09287
2 changed files with 7 additions and 7 deletions
|
|
@ -36,12 +36,12 @@ public final class HlsMediaPlaylist extends HlsPlaylist {
|
||||||
public final boolean isEncrypted;
|
public final boolean isEncrypted;
|
||||||
public final String encryptionKeyUri;
|
public final String encryptionKeyUri;
|
||||||
public final String encryptionIV;
|
public final String encryptionIV;
|
||||||
public final int byterangeOffset;
|
public final long byterangeOffset;
|
||||||
public final int byterangeLength;
|
public final long byterangeLength;
|
||||||
|
|
||||||
public Segment(String uri, double durationSecs, int discontinuitySequenceNumber,
|
public Segment(String uri, double durationSecs, int discontinuitySequenceNumber,
|
||||||
long startTimeUs, boolean isEncrypted, String encryptionKeyUri, String encryptionIV,
|
long startTimeUs, boolean isEncrypted, String encryptionKeyUri, String encryptionIV,
|
||||||
int byterangeOffset, int byterangeLength) {
|
long byterangeOffset, long byterangeLength) {
|
||||||
this.url = uri;
|
this.url = uri;
|
||||||
this.durationSecs = durationSecs;
|
this.durationSecs = durationSecs;
|
||||||
this.discontinuitySequenceNumber = discontinuitySequenceNumber;
|
this.discontinuitySequenceNumber = discontinuitySequenceNumber;
|
||||||
|
|
|
||||||
|
|
@ -244,8 +244,8 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
|
||||||
double segmentDurationSecs = 0.0;
|
double segmentDurationSecs = 0.0;
|
||||||
int discontinuitySequenceNumber = 0;
|
int discontinuitySequenceNumber = 0;
|
||||||
long segmentStartTimeUs = 0;
|
long segmentStartTimeUs = 0;
|
||||||
int segmentByterangeOffset = 0;
|
long segmentByterangeOffset = 0;
|
||||||
int segmentByterangeLength = C.LENGTH_UNBOUNDED;
|
long segmentByterangeLength = C.LENGTH_UNBOUNDED;
|
||||||
int segmentMediaSequence = 0;
|
int segmentMediaSequence = 0;
|
||||||
|
|
||||||
boolean isEncrypted = false;
|
boolean isEncrypted = false;
|
||||||
|
|
@ -279,9 +279,9 @@ public final class HlsPlaylistParser implements UriLoadable.Parser<HlsPlaylist>
|
||||||
} else if (line.startsWith(BYTERANGE_TAG)) {
|
} else if (line.startsWith(BYTERANGE_TAG)) {
|
||||||
String byteRange = HlsParserUtil.parseStringAttr(line, BYTERANGE_REGEX, BYTERANGE_TAG);
|
String byteRange = HlsParserUtil.parseStringAttr(line, BYTERANGE_REGEX, BYTERANGE_TAG);
|
||||||
String[] splitByteRange = byteRange.split("@");
|
String[] splitByteRange = byteRange.split("@");
|
||||||
segmentByterangeLength = Integer.parseInt(splitByteRange[0]);
|
segmentByterangeLength = Long.parseLong(splitByteRange[0]);
|
||||||
if (splitByteRange.length > 1) {
|
if (splitByteRange.length > 1) {
|
||||||
segmentByterangeOffset = Integer.parseInt(splitByteRange[1]);
|
segmentByterangeOffset = Long.parseLong(splitByteRange[1]);
|
||||||
}
|
}
|
||||||
} else if (line.startsWith(DISCONTINUITY_SEQUENCE_TAG)) {
|
} else if (line.startsWith(DISCONTINUITY_SEQUENCE_TAG)) {
|
||||||
discontinuitySequenceNumber = Integer.parseInt(line.substring(line.indexOf(':') + 1));
|
discontinuitySequenceNumber = Integer.parseInt(line.substring(line.indexOf(':') + 1));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue