-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Implemented smooth audio switching #7575
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
Implemented smooth audio switching #7575
Conversation
# Conflicts: # src/controller/stream-controller.ts
…smux complete, which is before buffering the new audio track's audio segment
src/types/media-playlist.ts
Outdated
| nextAudioTrackSwitchingSafetyDelay?: number; | ||
| nextAudioTrackBufferFlushDelay?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AudioSelectionOption is intended to describe the preferred audio of the user, not how to get the option or switch between options. AudioSelectionOption should remain limited to a subset of MediaPlaylist attributes and audio characteristic adjacent properties.
If these new options are necessary, then they should be added to HlsConfig with defaults. Since I don't see any defaults, are they even necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just removed nextAudioTrackSwitchingSafetyDelay & renamed nextAudioTrackBufferFlushDelay to nextAudioTrackBufferFlushForwardOffset to be more accurate and put that into HlsConfig with a default value.
|
Add unit tests before aproving/merging. |
|
@krseager it looks like all the feedback has been addressed - did I miss anything? Any ETA on adding tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with one suggestion for follow-up:
flushImmediate should be added as an optional property in AudioSelectionOption, so that the default behavior can be overridden when using hls.setAudioOption to change audio tracks.
// Make a "smooth" track change to a rendition matching the audio option criteria
// (`lang`, `channels`, etc...)
hls.setAudioOption({ /* track criteria */, flushImmediate: false });- Filed as #7692
(fixes regression introduced in #7575)
This PR will implement smooth audio track switching.
Why is this Pull Request needed?
Are there any points in the code the reviewer needs to double check?
Resolves issues:
Checklist