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

Exit gracefully when switching to an audio group with no tracks #5822

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Sep 13, 2023

This PR will...

Exit gracefully when switching to an audio group with no (supported) tracks

Why is this Pull Request needed?

Users report receiving a fatal error in streams with no audio tracks (but audio groups?)

Are there any points in the code the reviewer needs to double check?

Resolves issues:

Related to #4602

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.5.0 milestone Sep 13, 2023
@robwalch robwalch requested a review from mtoczko September 13, 2023 18:24
@robwalch
Copy link
Collaborator Author

@mtoczko
Copy link
Collaborator

mtoczko commented Sep 16, 2023

Hi @robwalch
Were you able to reproduce this error? Because on my computer, the audio controller didn't return such an error. (#4602 )

This PR will fix the issue, but nonetheless, I'd like to investigate the cause independently because from the description, it seems to occur randomly.

I can repro on the demo page as well. It doesn't happen 100% of the time, but if you retry enough (like, re-clicking the "Apply" button) it will happen eventually. Demo link

@robwalch
Copy link
Collaborator Author

robwalch commented Sep 18, 2023

Hi @mtoczko,

I was not able to reproduce this issue.

I have seen similar failures where the track selection fallback was broken before this change was made:

https://github.com/video-dev/hls.js/pull/5562/files#diff-fce83d85205f6441ddd410c5aca54bf4215dcbe6c16b6184af98ae438f930626L212-R215

It is not clear how the audio track controller would get a level switch to have a level with audio group ids but no tracks - especially with an asset that has no audio groups. Maybe by (guesses):

  1. Calling hls.audioTrack = N while playing an asset that has no tracks to select?
  2. Reusing the player instance?
  3. Manipulating level and track data?
  4. Forcing a level switch in a player event loop before group tracks are reset?
  5. Asset issue not captured in the issue thread - not caught by m3u8 parser?

Either way, I wanted to provide a safer exit path than what was being suggested as a workaround in #4602.

I changed the description to "Related to #4602", since this PR does not conclusively resolve #4602. This PR will prevent the escapes users were reporting later in the thread.

@robwalch robwalch merged commit f888cb5 into master Sep 18, 2023
@robwalch robwalch deleted the bugfix/switch-to-audio-group-with-no-tracks branch September 18, 2023 23:14
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