Deps: Replace OnceCell with std::sync::OnceLock (#207)

This commit is contained in:
Gnome!
2023-12-02 17:22:00 +00:00
committed by Kyle Simpson
parent 2146846df4
commit 743a1d262e
11 changed files with 59 additions and 58 deletions

View File

@@ -2,7 +2,7 @@ use super::{compressed_cost_per_sec, default_config, CodecCacheError, ToAudioByt
use crate::{
constants::*,
input::{
codecs::{dca::*, CODEC_REGISTRY, PROBE},
codecs::{dca::*, get_codec_registry, get_probe},
AudioStream,
Input,
LiveInput,
@@ -52,17 +52,13 @@ use tracing::{debug, trace};
pub struct Config {
/// Registry of audio codecs supported by the driver.
///
/// Defaults to [`CODEC_REGISTRY`], which adds audiopus-based Opus codec support
/// Defaults to [`get_codec_registry`], which adds audiopus-based Opus codec support
/// to all of Symphonia's default codecs.
///
/// [`CODEC_REGISTRY`]: static@CODEC_REGISTRY
pub codec_registry: &'static CodecRegistry,
/// Registry of the muxers and container formats supported by the driver.
///
/// Defaults to [`PROBE`], which includes all of Symphonia's default format handlers
/// Defaults to [`get_probe`], which includes all of Symphonia's default format handlers
/// and DCA format support.
///
/// [`PROBE`]: static@PROBE
pub format_registry: &'static Probe,
/// Configuration for the inner streamcatcher instance.
///
@@ -73,8 +69,8 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Self {
codec_registry: &CODEC_REGISTRY,
format_registry: &PROBE,
codec_registry: get_codec_registry(),
format_registry: get_probe(),
streamcatcher: ScConfig::default(),
}
}