From 156237af1ad8ac87b46d124eefe2b9c81b9b3943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 07:43:26 +0300 Subject: [PATCH] ec-mp4 QuickTime PCM over 2 channels: sound description version 2 is an lpcm entry, and ends with a constant 24 after frames-per-packet. Pinned ffmpeg 9.0.2 writes lpcm for 3/6/8 channels at s24le/s24be/s32be/f32le, with 0x18 in that last field every time; ours wrote in24 and 36 bytes, so the qt_pcm_hdr 5.1 cases failed --- crates/ec-mp4/src/mux.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ec-mp4/src/mux.rs b/crates/ec-mp4/src/mux.rs index f1d9a0af..165d1686 100644 --- a/crates/ec-mp4/src/mux.rs +++ b/crates/ec-mp4/src/mux.rs @@ -1419,6 +1419,7 @@ fn sample_entry( } let (name, audio) = match info.params.audio() { + Some(audio) if qt_pcm(codec).is_some() && audio.layout.channel_count() > 2 => (b"lpcm", audio), Some(audio) => (audio_entry(codec)?, audio), None => { return Err(Error::unsupported( @@ -1468,6 +1469,7 @@ fn sample_entry( out.extend_from_slice(&flags.to_be_bytes()); out.extend_from_slice(&(bytes * channels).to_be_bytes()); out.extend_from_slice(&1u32.to_be_bytes()); + out.extend_from_slice(&24u32.to_be_bytes()); } Some((bytes, little)) => { out.extend_from_slice(&1u32.to_be_bytes()); // samples per packet