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 {
373373 | CodecId::PcmS16Le
374374 | CodecId::PcmS16Be
375375 | CodecId::PcmS24Le
376+ | CodecId::PcmS24Be
376377 | CodecId::PcmS32Le
378+ | CodecId::PcmS32Be
377379 | CodecId::PcmF32Le
378380 )
379381 }
@@ -462,10 +464,18 @@ fn pcm(codec: CodecId, data: &[u8], out: &mut Vec<f32>) {
462464 let v = i32::from_le_bytes([0, c[0], c[1], c[2]]);
463465 v as f32 / 2147483648.0
464466 })),
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+ })),
465471 CodecId::PcmS32Le => out.extend(
466472 data.as_chunks::<4>().0.iter()
467473 .map(|c| i32::from_le_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0),
468474 ),
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+ ),
469479 CodecId::PcmF32Le => out.extend(
470480 data.as_chunks::<4>().0.iter()
471481 .map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]])),