forge
Explore
Log in

Don't you dare go Hollow

ec-mp4: drop stray 24 after QuickTime v2 lpcm block (5.1 PCM chan not found)

Browse files at this commit

185a642d010ba8430f153b9b6cb7eb7a86fb7e5bAhmet Kaan GümüşParent: 76482df
Root cause: mux.rs sample_entry v2 branch wrote an extra u32 (24) after the
72-byte v2 block fields, so the chan box landed at offset 76 instead of 72.
ffprobe reads the entry's extension size (72), finds a 24-byte box whose type
is not chan, and reports channel_layout unknown for lpcm 5.1.

ffmpeg 9.0.2 reference (6ch pcm_s24le .mov): lpcm entry is 96 bytes, v2 block
ends at offset 72, chan box 0x18 'chan' tag 0x00010000 bitmap 0x3f at 72.
Fix makes the entry 96 bytes with chan at 72, byte-equal to ffmpeg.
crates/ec-mp4/src/mux.rsmodified+0 -1
@@ -1478,7 +1478,6 @@ fn sample_entry(
14781478 out.extend_from_slice(&flags.to_be_bytes());
14791479 out.extend_from_slice(&(bytes * channels).to_be_bytes());
14801480 out.extend_from_slice(&1u32.to_be_bytes());
1481- out.extend_from_slice(&24u32.to_be_bytes());
14821481 }
14831482 Some((bytes, little)) => {
14841483 out.extend_from_slice(&1u32.to_be_bytes()); // samples per packet