Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 58 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ claxon = { version = "0.4", optional = true }
hound = { version = "3.5", optional = true }
lewton = { version = "0.10", optional = true }
minimp3_fixed = { version = "0.5.4", optional = true }
symphonia = { version = "0.5.5", optional = true, default-features = false }
symphonia = { version = "0.6.1", optional = true, default-features = false }
crossbeam-channel = { version = "0.5.15", optional = true }
thiserror = "2"

Expand All @@ -168,7 +168,7 @@ rtrb = { version = "0.3.2", optional = true }
# Rubato resampling
rubato = { version = "3.0", default-features = false }

symphonia-adapter-libopus = { version = "0.2", optional = true }
symphonia-adapter-libopus = { version = "0.3", optional = true }

[dev-dependencies]
quickcheck = "1"
Expand All @@ -177,7 +177,7 @@ rstest_reuse = "0.7"
approx = "0.5.1"
divan = "0.1.14"
inquire = "0.9.3"
symphonia-adapter-fdk-aac = "0.1"
symphonia-adapter-fdk-aac = "0.2"
clap = { version = "4", features = ["derive"] }

[[bench]]
Expand Down
17 changes: 10 additions & 7 deletions src/decoder/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use crate::decoder::symphonia::Registry;
use self::read_seek_source::ReadSeekSource;
#[cfg(feature = "symphonia")]
use ::symphonia::core::{
codecs::CodecRegistry,
codecs::registry::{CodecRegistry, RegisterableAudioDecoder},
io::{MediaSource, MediaSourceStream},
};
#[cfg(feature = "symphonia")]
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Default for Settings {
let mut codec_registry = CodecRegistry::new();
register_enabled_codecs(&mut codec_registry);
#[cfg(feature = "symphonia-libopus")]
codec_registry.register_all::<symphonia_adapter_libopus::OpusDecoder>();
codec_registry.register_audio_decoder::<symphonia_adapter_libopus::OpusDecoder>();
Registry::new(codec_registry)
},
}
Expand Down Expand Up @@ -257,9 +257,12 @@ impl<R: Read + Seek + Send + Sync + 'static> DecoderBuilder<R> {
#[cfg(feature = "symphonia")]
pub fn with_symphonia_decoder<D>(self) -> Self
where
D: ::symphonia::core::codecs::Decoder,
D: RegisterableAudioDecoder,
{
self.settings.codec_registry.write().register_all::<D>();
self.settings
.codec_registry
.write()
.register_audio_decoder::<D>();
self
}

Expand Down Expand Up @@ -296,7 +299,7 @@ impl<R: Read + Seek + Send + Sync + 'static> DecoderBuilder<R> {
}

/// Creates the decoder implementation with configured settings.
fn build_impl(self) -> Result<(DecoderImpl<R>, Settings), DecoderError> {
fn build_impl(self) -> Result<(DecoderImpl<'static, R>, Settings), DecoderError> {
let data = self.data.ok_or(DecoderError::UnrecognizedFormat)?;

#[cfg(all(feature = "hound", not(feature = "symphonia-wav")))]
Expand Down Expand Up @@ -346,7 +349,7 @@ impl<R: Read + Seek + Send + Sync + 'static> DecoderBuilder<R> {
///
/// Returns `DecoderError::UnrecognizedFormat` if the audio format could not be determined
/// or is not supported.
pub fn build(self) -> Result<Decoder<R>, DecoderError> {
pub fn build(self) -> Result<Decoder<'static, R>, DecoderError> {
let (decoder, _) = self.build_impl()?;
Ok(Decoder(decoder))
}
Expand All @@ -357,7 +360,7 @@ impl<R: Read + Seek + Send + Sync + 'static> DecoderBuilder<R> {
///
/// Returns `DecoderError::UnrecognizedFormat` if the audio format could not be determined
/// or is not supported.
pub fn build_looped(self) -> Result<LoopedDecoder<R>, DecoderError> {
pub fn build_looped(self) -> Result<LoopedDecoder<'static, R>, DecoderError> {
let (decoder, settings) = self.build_impl()?;
Ok(LoopedDecoder {
inner: Some(decoder),
Expand Down
Loading
Loading