feat(mp4): add wave box for QuickTime audio decoder configuration - #547
Open
nchitkara-xai wants to merge 1 commit into
Open
feat(mp4): add wave box for QuickTime audio decoder configuration#547nchitkara-xai wants to merge 1 commit into
nchitkara-xai wants to merge 1 commit into
Conversation
The QuickTime siDecompressionParam atom (wave) wraps the decoder configuration of QuickTime audio sample entries, so the esds of such an entry was unreachable as an opaque UnknownBox payload. Add a WaveBox container that decodes frma and esds children, keeps children that do not decode cleanly as UnknownBox (such as the 12-byte mp4a stub), and preserves a tail that is not a well-formed box (such as a size-zero terminator atom) verbatim in RawTail, so round trips stay byte-exact. The box is reachable as AudioSampleEntryBox.Wave.
nchitkara-xai
force-pushed
the
wave-box
branch
from
August 11, 2026 07:31
13c6fb4 to
26406a7
Compare
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.
Problem
The QuickTime siDecompressionParam atom (
wave) wraps the decoderconfiguration of QuickTime audio sample entries, so the esds of such an entry
is unreachable as an opaque
UnknownBoxpayload.Fix
A
WaveBoxcontainer decodesfrmaandesdschildren (reachable asAudioSampleEntryBox.Wave.Esds), and stays byte-exact for the irregularcontent wave atoms carry in the wild:
mp4astub, or anesds whose decode consumes fewer bytes than its declared size — is kept as
an
UnknownBoxwith its bytes verbatim;written with size zero — is preserved verbatim in
RawTail.Decoding a wave body never fails, so garbage inside a wave cannot make a
sample entry undecodable (and cannot trip the ISO-layout fallback of #544).
Tests
Typed frma/esds decode, stub and malformed-esds fallback to
UnknownBox,size-zero terminator tail, programmatic construction, and a wave-wrapped esds
inside a version 1 sound sample entry — all byte-exact through both decode
paths.
go test ./...,go vet,gofmt,golangci-lintpass.