Skip to content

Commit

Permalink
fix(HLS): Ensure that skipped segments are considered
Browse files Browse the repository at this point in the history
  • Loading branch information
diogoazevedos committed Jul 13, 2023
1 parent 9ee424f commit 2b9edb1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,14 @@ shaka.hls.HlsParser = class {
stream.segmentIndex.mergeAndEvict(
segments, this.presentationTimeline_.getSegmentAvailabilityStart());
if (segments.length) {
const skipTag = shaka.hls.Utils.getFirstTagWithName(
playlist.tags, 'EXT-X-SKIP');
const skippedSegments = skipTag ? Number(
skipTag.getRequiredAttrValue('SKIPPED-SEGMENTS')) : 0;
const mediaSequenceNumber = shaka.hls.Utils.getFirstTagWithNameAsNumber(
playlist.tags, 'EXT-X-MEDIA-SEQUENCE', 0);
const {nextMediaSequence, nextPart} =
this.getNextMediaSequenceAndPart_(mediaSequenceNumber, segments);
const {nextMediaSequence, nextPart} = this.getNextMediaSequenceAndPart_(
mediaSequenceNumber + skippedSegments, segments);
streamInfo.nextMediaSequence = nextMediaSequence;
streamInfo.nextPart = nextPart;
const playlistStartTime = mediaSequenceToStartTime.get(
Expand Down

0 comments on commit 2b9edb1

Please sign in to comment.