diff --git a/crates/ec-probe/Cargo.toml b/crates/ec-probe/Cargo.toml index 6a8aa309..34308b90 100644 --- a/crates/ec-probe/Cargo.toml +++ b/crates/ec-probe/Cargo.toml @@ -12,6 +12,7 @@ ec-ac3 = { workspace = true } ec-alac = { workspace = true } ec-amr = { workspace = true } ec-core = { workspace = true } +ec-dts = { workspace = true } ec-flac = { workspace = true } ec-pcm-ext = { workspace = true } ec-matroska = { workspace = true } diff --git a/crates/ec-probe/src/decoder.rs b/crates/ec-probe/src/decoder.rs index 931b10aa..dcdf5074 100644 --- a/crates/ec-probe/src/decoder.rs +++ b/crates/ec-probe/src/decoder.rs @@ -25,6 +25,7 @@ enum Inner { AmrNb(Box), AmrWb(Box), Opus(Box), + Dts(Box), /// PCM needs no decoder, only a reading of the bytes. Pcm(PcmFormat), } @@ -158,6 +159,7 @@ impl AudioDecoder { 48_000, streams, coupled, &mapping, )?)) } + CodecId::Dts => Inner::Dts(Box::new(ec_dts::DtsDecoder::new())), codec => match PcmFormat::of(codec) { Some(format) => Inner::Pcm(format), None => { @@ -216,6 +218,7 @@ impl AudioDecoder { Inner::Vorbis(d) => drain(d.as_mut(), packet, out)?, Inner::Ac3(d) => drain(d.as_mut(), packet, out)?, Inner::TrueHd(d) => drain(d.as_mut(), packet, out)?, + Inner::Dts(d) => drain(d.as_mut(), packet, out)?, Inner::Aac(d) => { let audio = d.decode(&packet.data, packet.pts)?; self.channels = usize::from(audio.channels).max(1); @@ -309,6 +312,7 @@ impl AudioDecoder { Inner::Vorbis(d) => flush_drain(d.as_mut(), out)?, Inner::Ac3(d) => flush_drain(d.as_mut(), out)?, Inner::TrueHd(d) => flush_drain(d.as_mut(), out)?, + Inner::Dts(d) => flush_drain(d.as_mut(), out)?, // AAC, ALAC, Opus and PCM decode a packet at a time with nothing // held back across the end of the file. Inner::Aac(_) | Inner::Alac(_) | Inner::PcmExt(_) | Inner::AmrNb(_) | Inner::AmrWb(_) | Inner::Opus(_) | Inner::Pcm(_) => {} @@ -352,6 +356,7 @@ impl AudioDecoder { Inner::Vorbis(d) => d.reset(), Inner::Ac3(d) => d.reset(), Inner::TrueHd(d) => d.reset(), + Inner::Dts(d) => ec_core::Decoder::reset(d.as_mut()), Inner::Aac(d) => { **d = match d.config().cloned() { Some(cfg) => ec_aac::AacDecoder::with_config(cfg),