mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 09:49:31 +02:00
Merge 50be702843
into a407beaa45
This commit is contained in:
commit
7fa143f218
3 changed files with 20 additions and 2 deletions
13
Cargo.lock
generated
13
Cargo.lock
generated
|
@ -3539,6 +3539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"symphonia-bundle-flac",
|
||||
"symphonia-bundle-mp3",
|
||||
"symphonia-codec-vorbis",
|
||||
"symphonia-core",
|
||||
|
@ -3546,6 +3547,18 @@ dependencies = [
|
|||
"symphonia-metadata",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "symphonia-bundle-flac"
|
||||
version = "0.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72e34f34298a7308d4397a6c7fbf5b84c5d491231ce3dd379707ba673ab3bd97"
|
||||
dependencies = [
|
||||
"log",
|
||||
"symphonia-core",
|
||||
"symphonia-metadata",
|
||||
"symphonia-utils-xiph",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "symphonia-bundle-mp3"
|
||||
version = "0.5.4"
|
||||
|
|
|
@ -85,6 +85,7 @@ symphonia = { version = "0.5", default-features = false, features = [
|
|||
"mp3",
|
||||
"ogg",
|
||||
"vorbis",
|
||||
"flac"
|
||||
] }
|
||||
|
||||
# Legacy Ogg container decoder for the passthrough decoder
|
||||
|
|
|
@ -10,8 +10,8 @@ use symphonia::{
|
|||
meta::{StandardTagKey, Value},
|
||||
},
|
||||
default::{
|
||||
codecs::{MpaDecoder, VorbisDecoder},
|
||||
formats::{MpaReader, OggReader},
|
||||
codecs::{FlacDecoder, MpaDecoder, VorbisDecoder},
|
||||
formats::{FlacReader, MpaReader, OggReader},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -48,6 +48,8 @@ impl SymphoniaDecoder {
|
|||
Box::new(OggReader::try_new(mss, &format_opts)?)
|
||||
} else if AudioFiles::is_mp3(file_format) {
|
||||
Box::new(MpaReader::try_new(mss, &format_opts)?)
|
||||
} else if AudioFiles::is_flac(file_format) {
|
||||
Box::new(FlacReader::try_new(mss, &format_opts)?)
|
||||
} else {
|
||||
return Err(DecoderError::SymphoniaDecoder(format!(
|
||||
"Unsupported format: {file_format:?}"
|
||||
|
@ -63,6 +65,8 @@ impl SymphoniaDecoder {
|
|||
Box::new(VorbisDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
||||
} else if AudioFiles::is_mp3(file_format) {
|
||||
Box::new(MpaDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
||||
} else if AudioFiles::is_flac(file_format) {
|
||||
Box::new(FlacDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
||||
} else {
|
||||
return Err(DecoderError::SymphoniaDecoder(format!(
|
||||
"Unsupported decoder: {file_format:?}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue