Repository navigation
Fix HLS audio codec declared for FLAC and unknown codecs - #7852
Merged
Merged
Conversation
To not send invalid info to players
Owner
|
Thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7784
When the audio rendition isn't one of the four codecs PeerTube knows about, the master playlist currently claims it's AAC (
mp4a.40.2). hls.js then sets up an AAC buffer, the real segments don't fit, and playback dies withbufferAppendError.Two changes in
getAudioStreamCodec():fLaC,ac-3,ec-3)CODECSis optional in HLS andhls.tsalready filters empty values out, so the player gets to detect the codec itself rather than being told something wrongStock PeerTube only produces AAC, so this mainly matters for transcoding plugins that copy the source audio, which is how the issue was found.
I added a small unit test (
server-helpers/ffmpeg-codecs.ts) covering the known mappings, an unknown codec and a file without audio. It fails on the currentdevelopand passes with the fix.If you'd rather keep AAC as the fallback, I can drop the second change and keep only the new mappings.