forge
Explore
Log in

Don't you dare go Hollow

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

Browse files at this commit

156237af1ad8ac87b46d124eefe2b9c81b9b3943Ahmet Kaan GümüşParent: 0a54b85
crates/ec-mp4/src/mux.rsmodified+2 -0
@@ -1419,6 +1419,7 @@ fn sample_entry(
1419 }1419 }
1420 1420
1421 let (name, audio) = match info.params.audio() {1421 let (name, audio) = match info.params.audio() {
1422+ Some(audio) if qt_pcm(codec).is_some() && audio.layout.channel_count() > 2 => (b"lpcm", audio),
1422 Some(audio) => (audio_entry(codec)?, audio),1423 Some(audio) => (audio_entry(codec)?, audio),
1423 None => {1424 None => {
1424 return Err(Error::unsupported(1425 return Err(Error::unsupported(
@@ -1468,6 +1469,7 @@ fn sample_entry(
1468 out.extend_from_slice(&flags.to_be_bytes());1469 out.extend_from_slice(&flags.to_be_bytes());
1469 out.extend_from_slice(&(bytes * channels).to_be_bytes());1470 out.extend_from_slice(&(bytes * channels).to_be_bytes());
1470 out.extend_from_slice(&1u32.to_be_bytes());1471 out.extend_from_slice(&1u32.to_be_bytes());
1472+ out.extend_from_slice(&24u32.to_be_bytes());
1471 }1473 }
1472 Some((bytes, little)) => {1474 Some((bytes, little)) => {
1473 out.extend_from_slice(&1u32.to_be_bytes()); // samples per packet1475 out.extend_from_slice(&1u32.to_be_bytes()); // samples per packet