Skip to content

fix(LCEVC): Create segmentIndex on makeAbortDecision_ #8838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,11 @@ shaka.media.StreamingEngine = class {
await originalStream.createSegmentIndex();
}

const dependencyStream = originalStream.dependencyStream;
if (dependencyStream && !dependencyStream.segmentIndex) {
await dependencyStream.createSegmentIndex();
}

if (mediaState.operation != originalOperation) {
// The original operation completed while we were getting a segment index,
// so there's nothing to do now.
Expand Down Expand Up @@ -1377,6 +1382,18 @@ shaka.media.StreamingEngine = class {
}
}

// If the stream has a dependency, make sure its segment index exists.
if (mediaState.dependencyMediaState) {
if (!mediaState.dependencyMediaState.stream.segmentIndex) {
try {
await mediaState.dependencyMediaState.stream.createSegmentIndex();
} catch (error) {
shaka.log.warning(
'Could not create segment index for dependency', error);
}
}
}

// Update the MediaState.
try {
const delay = this.update_(mediaState);
Expand Down
Loading