You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HLSVideoEngine: MP3 stream-copy emits mp4a.40.34, AVPlayer fails with -11829 #6
AudioCodecCompat.mp3 is classified as fMP4-legal stream-copy at HLSVideoEngine.swift:81 (and emitted as mp4a.40.34 per hlsCodecsString). AVPlayer reads the mp4a sample entry as AAC and fails to decode the MP3 frames, returning:
This mirrors the documented Opus behaviour already handled in requiresBridge (codec is spec-legal in fMP4 but AVPlayer's downstream handling rejects it).
Reproduction
Load a source whose audio stream is MP3 (e.g. MP3 audio in an .mov container).
Engine routes through the native HLS-fMP4 path.
Log line appears: [HLSVideoEngine] audio: codec=mp3 → stream-copy as \mp4a.40.34``.
AVPlayer fails on first segment with -11829 / -12848 within a few hundred ms.
Fix
Add .mp3 to AudioCodecCompat.requiresBridge, alongside .opus. MP3 then routes through the FLAC bridge (decode → S16 PCM → FLAC re-encode), emitting an fLaC audio track AVPlayer handles cleanly.
Diff and message in this branch (combined with #5):
Trade-off: MP3 sources lose their stream-copy zero-overhead path, but bridge cost on a lossy mono/stereo source is negligible compared to TrueHD/DTS where the bridge is already engaged.
Verification
Tested on a real MP3-in-mov source via the tvOS 26 simulator (Apple TV 4K 3rd gen runtime). Pre-fix: -11829 within ~200ms. Post-fix: audio: codec=mp3 (bridge required), AVPlayer reaches readyToPlay and timeControlStatus=playing, segments serve cleanly via the local HLS server.
Fixed in 3773f61. MP3 is now in requiresBridge alongside Opus, so it routes through the FLAC bridge instead of stream-copying as mp4a.40.34. The hlsCodecsString case for .mp3 is collapsed into the bridged-codecs branch since it's no longer reachable on the stream-copy path.
Thanks for the precise repro + diagnosis. Sodalite has picked up the bump.
Activity
fix(audio): route MP3 through FLAC bridge, AVPlayer rejects mp4a.40.34
superuser404notfound commentedon May 16, 2026
Fixed in 3773f61. MP3 is now in
requiresBridgealongside Opus, so it routes through the FLAC bridge instead of stream-copying asmp4a.40.34. The hlsCodecsString case for.mp3is collapsed into the bridged-codecs branch since it's no longer reachable on the stream-copy path.Thanks for the precise repro + diagnosis. Sodalite has picked up the bump.
fix(sw-decode): present untagged SD pictures as BT.601, not BT.709 (s…
fix(color): give hardware-decoded and still SD pictures the same BT.6…
fix(sw-decode): present untagged SD pictures as BT.601, not BT.709 (s…
fix(color): give hardware-decoded and still SD pictures the same BT.6…
fix(audio): a negative audio delay cuts the start at the sample inste…
fix(audio): a negative audio delay cuts the start at the sample inste…