forge
Explore
Log in

Don't you dare go Hollow

S1: AudioDecoder decodes DTS through ec-dts (was an unsupported arm; capability gap)

Browse files at this commit

50f88ea1ad4fe9801b41ce8e1b513dbec18c9b33Ahmet Kaan GümüşParent: d2e45f5
crates/ec-probe/Cargo.tomlmodified+1 -0
@@ -12,6 +12,7 @@ ec-ac3 = { workspace = true }
1212 ec-alac = { workspace = true }
1313 ec-amr = { workspace = true }
1414 ec-core = { workspace = true }
15+ec-dts = { workspace = true }
1516 ec-flac = { workspace = true }
1617 ec-pcm-ext = { workspace = true }
1718 ec-matroska = { workspace = true }
crates/ec-probe/src/decoder.rsmodified+5 -0
@@ -25,6 +25,7 @@ enum Inner {
2525 AmrNb(Box<ec_amr::nb::decoder::AmrNbDecoder>),
2626 AmrWb(Box<ec_amr::wb::AmrWbDecoder>),
2727 Opus(Box<ec_opus::MultistreamDecoder>),
28+ Dts(Box<ec_dts::DtsDecoder>),
2829 /// PCM needs no decoder, only a reading of the bytes.
2930 Pcm(PcmFormat),
3031 }
@@ -158,6 +159,7 @@ impl AudioDecoder {
158159 48_000, streams, coupled, &mapping,
159160 )?))
160161 }
162+ CodecId::Dts => Inner::Dts(Box::new(ec_dts::DtsDecoder::new())),
161163 codec => match PcmFormat::of(codec) {
162164 Some(format) => Inner::Pcm(format),
163165 None => {
@@ -216,6 +218,7 @@ impl AudioDecoder {
216218 Inner::Vorbis(d) => drain(d.as_mut(), packet, out)?,
217219 Inner::Ac3(d) => drain(d.as_mut(), packet, out)?,
218220 Inner::TrueHd(d) => drain(d.as_mut(), packet, out)?,
221+ Inner::Dts(d) => drain(d.as_mut(), packet, out)?,
219222 Inner::Aac(d) => {
220223 let audio = d.decode(&packet.data, packet.pts)?;
221224 self.channels = usize::from(audio.channels).max(1);
@@ -309,6 +312,7 @@ impl AudioDecoder {
309312 Inner::Vorbis(d) => flush_drain(d.as_mut(), out)?,
310313 Inner::Ac3(d) => flush_drain(d.as_mut(), out)?,
311314 Inner::TrueHd(d) => flush_drain(d.as_mut(), out)?,
315+ Inner::Dts(d) => flush_drain(d.as_mut(), out)?,
312316 // AAC, ALAC, Opus and PCM decode a packet at a time with nothing
313317 // held back across the end of the file.
314318 Inner::Aac(_) | Inner::Alac(_) | Inner::PcmExt(_) | Inner::AmrNb(_) | Inner::AmrWb(_) | Inner::Opus(_) | Inner::Pcm(_) => {}
@@ -352,6 +356,7 @@ impl AudioDecoder {
352356 Inner::Vorbis(d) => d.reset(),
353357 Inner::Ac3(d) => d.reset(),
354358 Inner::TrueHd(d) => d.reset(),
359+ Inner::Dts(d) => ec_core::Decoder::reset(d.as_mut()),
355360 Inner::Aac(d) => {
356361 **d = match d.config().cloned() {
357362 Some(cfg) => ec_aac::AacDecoder::with_config(cfg),