Input: lazy_static -> once_cell::sync::Lazy (#136)
This commit is contained in:
@@ -5,30 +5,25 @@ mod opus;
|
||||
mod raw;
|
||||
|
||||
pub use self::{dca::DcaReader, opus::OpusDecoder, raw::*};
|
||||
use lazy_static::lazy_static;
|
||||
use once_cell::sync::Lazy;
|
||||
use symphonia::{
|
||||
core::{codecs::CodecRegistry, probe::Probe},
|
||||
default::*,
|
||||
};
|
||||
|
||||
lazy_static! {
|
||||
/// Default Symphonia CodecRegistry, including the (audiopus-backed)
|
||||
/// Opus codec.
|
||||
pub static ref CODEC_REGISTRY: CodecRegistry = {
|
||||
let mut registry = CodecRegistry::new();
|
||||
register_enabled_codecs(&mut registry);
|
||||
registry.register_all::<OpusDecoder>();
|
||||
registry
|
||||
};
|
||||
}
|
||||
/// Default Symphonia [`CodecRegistry`], including the (audiopus-backed) Opus codec.
|
||||
pub static CODEC_REGISTRY: Lazy<CodecRegistry> = Lazy::new(|| {
|
||||
let mut registry = CodecRegistry::new();
|
||||
register_enabled_codecs(&mut registry);
|
||||
registry.register_all::<OpusDecoder>();
|
||||
registry
|
||||
});
|
||||
|
||||
lazy_static! {
|
||||
/// Default Symphonia Probe, including DCA format support.
|
||||
pub static ref PROBE: Probe = {
|
||||
let mut probe = Probe::default();
|
||||
probe.register_all::<DcaReader>();
|
||||
probe.register_all::<RawReader>();
|
||||
register_enabled_formats(&mut probe);
|
||||
probe
|
||||
};
|
||||
}
|
||||
/// Default Symphonia Probe, including DCA format support.
|
||||
pub static PROBE: Lazy<Probe> = Lazy::new(|| {
|
||||
let mut probe = Probe::default();
|
||||
probe.register_all::<DcaReader>();
|
||||
probe.register_all::<RawReader>();
|
||||
register_enabled_formats(&mut probe);
|
||||
probe
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user