Skip to content

Commit

Permalink
fix(DASH): Evict (by time) indexes in MetaSegmentIndex (#7296)
Browse files Browse the repository at this point in the history
Issue #6239
  • Loading branch information
avelad authored and joeyparrish committed Sep 13, 2024
1 parent 8131b91 commit 47c5562
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/media/segment_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
* @export
*/
evict(time) {
// evict() is only used internally by the DASH and HLS parser on
// SegmentIndexes, but never on MetaSegmentIndex.
goog.asserts.assert(
false, 'evict() should not be used in MetaSegmentIndex!');
for (const index of this.indexes_) {
index.evict(time);
}
this.evictEmpty();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,8 @@ shaka.media.StreamingEngine = class {
async evict_(mediaState, presentationTime) {
const segmentIndex = mediaState.stream.segmentIndex;
if (segmentIndex instanceof shaka.media.MetaSegmentIndex) {
segmentIndex.evictEmpty();
segmentIndex.evict(
this.manifest_.presentationTimeline.getSeekRangeStart());
}

const logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);
Expand Down

0 comments on commit 47c5562

Please sign in to comment.