Skip to content
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

fix: Evict the buffer against seekRangeStart #8026

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

avelad
Copy link
Member

@avelad avelad commented Feb 6, 2025

This avoid keep in the buffer content that is not necessary.

This avoid keep in the buffer content that is not necessary.
@avelad avelad added type: bug Something isn't working correctly priority: P1 Big impact or workaround impractical; resolve before feature release labels Feb 6, 2025
@avelad avelad added this to the v4.14 milestone Feb 6, 2025
@@ -1424,7 +1424,7 @@ shaka.media.MediaSourceEngine = class {
const ContentType = shaka.util.ManifestParserUtils.ContentType;
if (contentType == ContentType.TEXT) {
await this.textEngine_.remove(startTime, endTime);
} else {
} else if (endTime > startTime) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an optimization to avoid adding an operation that would do nothing.

this.manifest_.presentationTimeline.getSeekRangeEnd();

let overflow = bufferedBehind - bufferBehind;
if (seekRangeEnd - seekRangeStart > 1) {
Copy link
Member Author

@avelad avelad Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some platforms require more than 1 second of buffer, otherwise errors occur.

@shaka-bot
Copy link
Collaborator

Incremental code coverage: 100.00%

@avelad avelad merged commit 44748b4 into shaka-project:main Feb 6, 2025
17 checks passed
@avelad avelad deleted the eviction branch February 6, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants