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

Reset MSE when switching codec if changeType is unstable or unavailable #4270

Conversation

matvp91
Copy link
Contributor

@matvp91 matvp91 commented Aug 31, 2023

Noticed on webOS 4, when switching audio track from one codec to another. A MEDIA_ERR_DECODE error is thrown and _handleMediaErrorDecode resets MSE. Waiting for decode error to occur is not favourable, thus introducing a new buffer setting resetSourceBuffersForTrackSwitch that resets MSE when we're switching to a new track with a different codec than the active track.

@matvp91 matvp91 changed the title Reset MSE when switching codec if changeType is unstable or unavailable WIP: Reset MSE when switching codec if changeType is unstable or unavailable Aug 31, 2023
@matvp91
Copy link
Contributor Author

matvp91 commented Aug 31, 2023

@dsilhavy as discussed on Slack, BufferController occasionally throws an error where the buffer sink is undefined, probably due to a pending operation on the old SourceBuffer. To be fair, I'm not sure how to continue with this as I'm not getting the full context yet. There might also be an easier way to tear down MSE and reset that I'm unaware of.

@dsilhavy dsilhavy added this to the 4.7.2 milestone Aug 31, 2023
index.d.ts Show resolved Hide resolved
@dsilhavy
Copy link
Collaborator

dsilhavy commented Sep 5, 2023

@matvp91 This looks good to me.

  • Can you add an additional check to BufferController:
    function getRangeAt(time, tolerance) {
        if (!sourceBufferSink) {
            return null;
        }
  • Please also resolve the conflicts with the current development branch

@matvp91 matvp91 changed the title WIP: Reset MSE when switching codec if changeType is unstable or unavailable Reset MSE when switching codec if changeType is unstable or unavailable Sep 6, 2023
@matvp91
Copy link
Contributor Author

matvp91 commented Sep 6, 2023

@dsilhavy Got it, I'll give this some final runs on a variety of webOS devices where this applies and we're all good after that I believe. Thanks for the info!

@matvp91
Copy link
Contributor Author

matvp91 commented Sep 8, 2023

@dsilhavy tested this on a variety of webOS devices and all looks good. Guess we're good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants