-
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
base: master
Are you sure you want to change the base?
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.
| ) { | ||
| const previousFrag = this.fragPlaying; | ||
|
|
||
| super.checkFragmentChanged(type); |
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.
Instead of having audio-stream-controller pass in AUDIO and stream-controller pass in MAIN, you can use this.playlistType in the base checkFragmentChanged method. (I'm assuming that only the fragment type relevant to each controller is ever checked.)
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.
Done
| const track = this.switchingTrack; | ||
| if (track) { | ||
| this.bufferedTrack = track; | ||
| this.switchingTrack = null; |
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.
Ensure no issues are encountered from this change with LL-HLS
|
Add unit tests before aproving/merging. |
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