Skip to content

fix: handle QuickTime wave/esds in mp4a codec derivation and fragmented init#550

Open
lideen wants to merge 2 commits intogpac:mainfrom
lideen:fix/mov-wave-esds-init-segmentation
Open

fix: handle QuickTime wave/esds in mp4a codec derivation and fragmented init#550
lideen wants to merge 2 commits intogpac:mainfrom
lideen:fix/mov-wave-esds-init-segmentation

Conversation

@lideen
Copy link
Contributor

@lideen lideen commented Feb 23, 2026

Description

I noticed some QT files were producing incomplete/incorrect audio codec strings and compatibility issues in my fragmented playback flows.

This PR improves handling of QuickTime-style audio sample entries in QT files where codec/config metadata is nested under wave.esds rather than exposed directly on the sample entry.

The underlying issue was about how mp4a sample entries can be structured in QuickTime files: mp4a.wave.esds instead of mp4a.esds.

This has two main issues:

  1. Codec derivation path for mp4a relies on direct esds
    • Nested wave.esds layouts fails to give the correct codec string.
  2. The current init segment generation does not work for nested wave.esds. The MSE apis expects init segments to have direct esds.

What changed

  1. mp4a codec derivation now supports nested QuickTime layout
    • For mp4a entries, codec derivation now resolves descriptor info from:
      • direct esds
      • nested wave.esds
  2. Init segment writing now normalizes mp4a.wave.esds layouts
    • During writeInitializationSegment(...), mp4a entries with nested wave.esds are normalized to direct esds representation.
    • Original in-memory parsed structures are restored after writing (no persistent source mutation).
@lideen lideen force-pushed the fix/mov-wave-esds-init-segmentation branch from e3642e6 to 514dbf1 Compare February 23, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant