mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 17:59:24 +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"
|
checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
"symphonia-bundle-flac",
|
||||||
"symphonia-bundle-mp3",
|
"symphonia-bundle-mp3",
|
||||||
"symphonia-codec-vorbis",
|
"symphonia-codec-vorbis",
|
||||||
"symphonia-core",
|
"symphonia-core",
|
||||||
|
@ -3546,6 +3547,18 @@ dependencies = [
|
||||||
"symphonia-metadata",
|
"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]]
|
[[package]]
|
||||||
name = "symphonia-bundle-mp3"
|
name = "symphonia-bundle-mp3"
|
||||||
version = "0.5.4"
|
version = "0.5.4"
|
||||||
|
|
|
@ -85,6 +85,7 @@ symphonia = { version = "0.5", default-features = false, features = [
|
||||||
"mp3",
|
"mp3",
|
||||||
"ogg",
|
"ogg",
|
||||||
"vorbis",
|
"vorbis",
|
||||||
|
"flac"
|
||||||
] }
|
] }
|
||||||
|
|
||||||
# Legacy Ogg container decoder for the passthrough decoder
|
# Legacy Ogg container decoder for the passthrough decoder
|
||||||
|
|
|
@ -10,8 +10,8 @@ use symphonia::{
|
||||||
meta::{StandardTagKey, Value},
|
meta::{StandardTagKey, Value},
|
||||||
},
|
},
|
||||||
default::{
|
default::{
|
||||||
codecs::{MpaDecoder, VorbisDecoder},
|
codecs::{FlacDecoder, MpaDecoder, VorbisDecoder},
|
||||||
formats::{MpaReader, OggReader},
|
formats::{FlacReader, MpaReader, OggReader},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ impl SymphoniaDecoder {
|
||||||
Box::new(OggReader::try_new(mss, &format_opts)?)
|
Box::new(OggReader::try_new(mss, &format_opts)?)
|
||||||
} else if AudioFiles::is_mp3(file_format) {
|
} else if AudioFiles::is_mp3(file_format) {
|
||||||
Box::new(MpaReader::try_new(mss, &format_opts)?)
|
Box::new(MpaReader::try_new(mss, &format_opts)?)
|
||||||
|
} else if AudioFiles::is_flac(file_format) {
|
||||||
|
Box::new(FlacReader::try_new(mss, &format_opts)?)
|
||||||
} else {
|
} else {
|
||||||
return Err(DecoderError::SymphoniaDecoder(format!(
|
return Err(DecoderError::SymphoniaDecoder(format!(
|
||||||
"Unsupported format: {file_format:?}"
|
"Unsupported format: {file_format:?}"
|
||||||
|
@ -63,6 +65,8 @@ impl SymphoniaDecoder {
|
||||||
Box::new(VorbisDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
Box::new(VorbisDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
||||||
} else if AudioFiles::is_mp3(file_format) {
|
} else if AudioFiles::is_mp3(file_format) {
|
||||||
Box::new(MpaDecoder::try_new(&track.codec_params, &decoder_opts)?)
|
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 {
|
} else {
|
||||||
return Err(DecoderError::SymphoniaDecoder(format!(
|
return Err(DecoderError::SymphoniaDecoder(format!(
|
||||||
"Unsupported decoder: {file_format:?}"
|
"Unsupported decoder: {file_format:?}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue