Skip to content

Commit

Permalink
Fix parsing byterange attribute in HlsParser.
Browse files Browse the repository at this point in the history
The BYTERANGE attribute on an hls playlist can either specify
start of the byterange and length or length only. If start
of the range is not specified, it means that the segment starts
right after the previous one, which means (prevSegment.endByte +
1). We used to have it as prevSegment.endByte instead.

Closes #925.

Change-Id: I207ed73dead7cba2c93587a00a519de5b5164f03
  • Loading branch information
ismena authored and joeyparrish committed Jul 25, 2017
1 parent c00f1c8 commit 7f50b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ shaka.hls.HlsParser.prototype.createSegments_ =
if (blocks[1]) {
startByte = Number(blocks[1]);
} else {
startByte = segments[index - 1].endByte;
startByte = segments[index - 1].endByte + 1;
}
endByte = startByte + byteLength - 1;

Expand Down

0 comments on commit 7f50b9c

Please sign in to comment.