S1: AudioDecoder decodes DTS through ec-dts (was an unsupported arm; capability gap)
Browse files at this commit50f88ea1ad4fe9801b41ce8e1b513dbec18c9b33Parent: d2e45f52 changed files +6 -0
crates/ec-probe/Cargo.tomlmodified+1 -0
| @@ -12,6 +12,7 @@ ec-ac3 = { workspace = true } | ||
| 12 | 12 | ec-alac = { workspace = true } |
| 13 | 13 | ec-amr = { workspace = true } |
| 14 | 14 | ec-core = { workspace = true } |
| 15 | +ec-dts = { workspace = true } | |
| 15 | 16 | ec-flac = { workspace = true } |
| 16 | 17 | ec-pcm-ext = { workspace = true } |
| 17 | 18 | ec-matroska = { workspace = true } |
crates/ec-probe/src/decoder.rsmodified+5 -0
| @@ -25,6 +25,7 @@ enum Inner { | ||
| 25 | 25 | AmrNb(Box<ec_amr::nb::decoder::AmrNbDecoder>), |
| 26 | 26 | AmrWb(Box<ec_amr::wb::AmrWbDecoder>), |
| 27 | 27 | Opus(Box<ec_opus::MultistreamDecoder>), |
| 28 | + Dts(Box<ec_dts::DtsDecoder>), | |
| 28 | 29 | /// PCM needs no decoder, only a reading of the bytes. |
| 29 | 30 | Pcm(PcmFormat), |
| 30 | 31 | } |
| @@ -158,6 +159,7 @@ impl AudioDecoder { | ||
| 158 | 159 | 48_000, streams, coupled, &mapping, |
| 159 | 160 | )?)) |
| 160 | 161 | } |
| 162 | + CodecId::Dts => Inner::Dts(Box::new(ec_dts::DtsDecoder::new())), | |
| 161 | 163 | codec => match PcmFormat::of(codec) { |
| 162 | 164 | Some(format) => Inner::Pcm(format), |
| 163 | 165 | None => { |
| @@ -216,6 +218,7 @@ impl AudioDecoder { | ||
| 216 | 218 | Inner::Vorbis(d) => drain(d.as_mut(), packet, out)?, |
| 217 | 219 | Inner::Ac3(d) => drain(d.as_mut(), packet, out)?, |
| 218 | 220 | Inner::TrueHd(d) => drain(d.as_mut(), packet, out)?, |
| 221 | + Inner::Dts(d) => drain(d.as_mut(), packet, out)?, | |
| 219 | 222 | Inner::Aac(d) => { |
| 220 | 223 | let audio = d.decode(&packet.data, packet.pts)?; |
| 221 | 224 | self.channels = usize::from(audio.channels).max(1); |
| @@ -309,6 +312,7 @@ impl AudioDecoder { | ||
| 309 | 312 | Inner::Vorbis(d) => flush_drain(d.as_mut(), out)?, |
| 310 | 313 | Inner::Ac3(d) => flush_drain(d.as_mut(), out)?, |
| 311 | 314 | Inner::TrueHd(d) => flush_drain(d.as_mut(), out)?, |
| 315 | + Inner::Dts(d) => flush_drain(d.as_mut(), out)?, | |
| 312 | 316 | // AAC, ALAC, Opus and PCM decode a packet at a time with nothing |
| 313 | 317 | // held back across the end of the file. |
| 314 | 318 | Inner::Aac(_) | Inner::Alac(_) | Inner::PcmExt(_) | Inner::AmrNb(_) | Inner::AmrWb(_) | Inner::Opus(_) | Inner::Pcm(_) => {} |
| @@ -352,6 +356,7 @@ impl AudioDecoder { | ||
| 352 | 356 | Inner::Vorbis(d) => d.reset(), |
| 353 | 357 | Inner::Ac3(d) => d.reset(), |
| 354 | 358 | Inner::TrueHd(d) => d.reset(), |
| 359 | + Inner::Dts(d) => ec_core::Decoder::reset(d.as_mut()), | |
| 355 | 360 | Inner::Aac(d) => { |
| 356 | 361 | **d = match d.config().cloned() { |
| 357 | 362 | Some(cfg) => ec_aac::AacDecoder::with_config(cfg), |