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: Fix exceptions in StreamingEngine when reloading #6466

Merged

Conversation

joeyparrish
Copy link
Member

When reloading MediaSourceEngine via StreamingEngine, some logic executed before the reload cancels operations and aligns StreamingEngine state with MediaSourceEngine.

However, additional logic was executed after setStreamProperties, which caused a race condition that broke StreamingEngine state by manipulating it out of the usual sequence and outside the usual methods, leading to exceptions and failed assertions. This removes that unnecessary logic and leaves subtle state management to the functions that are meant to do it.

Closes #6458

When reloading MediaSourceEngine via StreamingEngine, some logic executed
before the reload cancels operations and aligns StreamingEngine state with
MediaSourceEngine.

However, additional logic was executed after setStreamProperties, which caused
a race condition that broke StreamingEngine state by manipulating it out of the
usual sequence and outside the usual methods, leading to exceptions and failed
assertions.  This removes that unnecessary logic and leaves subtle state
management to the functions that are meant to do it.

Closes shaka-project#6458
@avelad avelad added type: bug Something isn't working correctly priority: P2 Smaller impact or easy workaround labels Apr 22, 2024
@avelad avelad added this to the v4.8 milestone Apr 22, 2024
@avelad
Copy link
Member

avelad commented Apr 22, 2024

@shaka-bot test

@shaka-bot
Copy link
Collaborator

@avelad: Lab tests started with arguments:

  • pr=6466

@shaka-bot
Copy link
Collaborator

Incremental code coverage: 100.00%

@joeyparrish joeyparrish merged commit d570ae1 into shaka-project:main Apr 22, 2024
36 checks passed
@joeyparrish joeyparrish deleted the fix-codec-switching-tests branch April 22, 2024 17:08
joeyparrish added a commit that referenced this pull request May 7, 2024
When reloading MediaSourceEngine via StreamingEngine, some logic executed before the reload cancels operations and aligns StreamingEngine state with MediaSourceEngine.

However, additional logic was executed after setStreamProperties, which caused a race condition that broke StreamingEngine state by manipulating it out of the usual sequence and outside the usual methods, leading to exceptions and failed assertions.  This removes that unnecessary logic and leaves subtle state management to the functions that are meant to do it.

Closes #6458
joeyparrish added a commit that referenced this pull request May 7, 2024
When reloading MediaSourceEngine via StreamingEngine, some logic executed before the reload cancels operations and aligns StreamingEngine state with MediaSourceEngine.

However, additional logic was executed after setStreamProperties, which caused a race condition that broke StreamingEngine state by manipulating it out of the usual sequence and outside the usual methods, leading to exceptions and failed assertions.  This removes that unnecessary logic and leaves subtle state management to the functions that are meant to do it.

Closes #6458

Backported to v4.6.x
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 21, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistent codec-switching test failure on Edge
4 participants