Revert "Speed up ALAC playback by using streaming decoder"
This reverts commit 20eac2f578.
This commit is contained in:
1 parent
20eac2f578
commit
ee8978819c
1 file changed
+8
-2
@@ -235,8 +235,14 @@ fn extract_audio_metadata(data: &[u8]) -> Result<(u32, u16), String> {
|
||||
fn decode_with_fallback(
|
||||
data: &[u8],
|
||||
) -> Result<Box<dyn Source<Item = i16> + Send>, String> {
|
||||
// Try rodio's Decoder first (supports ALAC via symphonia-all feature)
|
||||
// This streams instead of decoding everything upfront
|
||||
if is_isomp4(data) {
|
||||
return decode_with_symphonia(data)
|
||||
.map(|specs| {
|
||||
log::info!("Decoded audio using symphonia fallback (isomp4)");
|
||||
Box::new(specs.samples) as Box<dyn Source<Item = i16> + Send>
|
||||
});
|
||||
}
|
||||
|
||||
let primary = panic::catch_unwind(AssertUnwindSafe(|| {
|
||||
Decoder::new(BufReader::new(Cursor::new(data.to_vec())))
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user