forge
Explore
Log in

Don't you dare go Hollow

B5: ec-probe reads PcmS24Be/PcmS32Be

Browse files at this commit

c776375d41664d3cb766e87d4956f77247111baaAhmet Kaan GümüşParent: 74c238b
Demux now maps A_PCM/INT/BIG to S24Be/S32Be, which ec-probe did not read
(is_pcm and pcm() lacked them), so those tracks would fail to decode. Added
the BE arms mirroring the LE ones. Only BE 24/32 PCM tracks are affected.
Evidence: cargo check and clippy ec-probe; orchestrator runs goldens.
crates/ec-probe/src/decoder.rsmodified+10 -0
@@ -373,7 +373,9 @@ fn is_pcm(codec: CodecId) -> bool {
373 | CodecId::PcmS16Le373 | CodecId::PcmS16Le
374 | CodecId::PcmS16Be374 | CodecId::PcmS16Be
375 | CodecId::PcmS24Le375 | CodecId::PcmS24Le
376+ | CodecId::PcmS24Be
376 | CodecId::PcmS32Le377 | CodecId::PcmS32Le
378+ | CodecId::PcmS32Be
377 | CodecId::PcmF32Le379 | CodecId::PcmF32Le
378 )380 )
379 }381 }
@@ -462,10 +464,18 @@ fn pcm(codec: CodecId, data: &[u8], out: &mut Vec<f32>) {
462 let v = i32::from_le_bytes([0, c[0], c[1], c[2]]);464 let v = i32::from_le_bytes([0, c[0], c[1], c[2]]);
463 v as f32 / 2147483648.0465 v as f32 / 2147483648.0
464 })),466 })),
467+ CodecId::PcmS24Be => out.extend(data.as_chunks::<3>().0.iter().map(|c| {
468+ let v = i32::from_be_bytes([c[0], c[1], c[2], 0]);
469+ v as f32 / 2147483648.0
470+ })),
465 CodecId::PcmS32Le => out.extend(471 CodecId::PcmS32Le => out.extend(
466 data.as_chunks::<4>().0.iter()472 data.as_chunks::<4>().0.iter()
467 .map(|c| i32::from_le_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0),473 .map(|c| i32::from_le_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0),
468 ),474 ),
475+ CodecId::PcmS32Be => out.extend(
476+ data.as_chunks::<4>().0.iter()
477+ .map(|c| i32::from_be_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0),
478+ ),
469 CodecId::PcmF32Le => out.extend(479 CodecId::PcmF32Le => out.extend(
470 data.as_chunks::<4>().0.iter()480 data.as_chunks::<4>().0.iter()
471 .map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]])),481 .map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]])),