diff options
| author | jakka <jakkadoujin@gmail.com> | 2025-06-15 14:12:50 +0300 |
|---|---|---|
| committer | jakka <jakkadoujin@gmail.com> | 2025-06-15 14:12:50 +0300 |
| commit | d239e5dbe1c35553c7663b8079719f327a1ddfaa (patch) | |
| tree | d4e766b6c0e38c745baf06d30c60a122c8dd1b72 /src/flac.rs | |
| parent | 11d428265b3f7f5541779ef2df24bfb17d7250aa (diff) | |
added final logic and cli flags
Diffstat (limited to 'src/flac.rs')
| -rw-r--r-- | src/flac.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/flac.rs b/src/flac.rs index 940e816..64ac6a9 100644 --- a/src/flac.rs +++ b/src/flac.rs @@ -20,6 +20,9 @@ use crate::files; pub const CURRENT_VENDOR: &str = "reference libFLAC 1.5.0 20250211"; +type BoxedFormatReader = Box<dyn FormatReader>; +type BoxedAudioDecoder = Box<dyn AudioDecoder + 'static>; + struct StreamConfig { channels: u32, bits_per_sample: Bps, @@ -187,11 +190,7 @@ fn encode_cycle_32( fn init_decoder( filename: impl AsRef<Path>, -) -> Result<( - Box<dyn FormatReader>, - Box<dyn AudioDecoder + 'static>, - StreamConfig, -)> { +) -> Result<(BoxedFormatReader, BoxedAudioDecoder, StreamConfig)> { let src = std::fs::File::open(filename)?; let mss = MediaSourceStream::new(Box::new(src), Default::default()); let mut hint = Hint::new(); |
