mirror of
https://github.com/RustAudio/rodio
synced 2024-12-14 06:02:31 +00:00
improved error handling pt 2
This commit is contained in:
parent
5f1b057b14
commit
eac5a32f3d
1 changed files with 5 additions and 9 deletions
|
@ -77,19 +77,15 @@ impl SymphoniaDecoder {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Select the first supported track
|
// Select the first supported track
|
||||||
let track_id = match probed
|
let track_id = probed
|
||||||
.format
|
.format
|
||||||
.tracks()
|
.tracks()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|t| t.codec_params.codec != CODEC_TYPE_NULL)
|
.find(|t| t.codec_params.codec != CODEC_TYPE_NULL)
|
||||||
{
|
.ok_or(symphonia::core::errors::Error::Unsupported(
|
||||||
Some(track) => track.id,
|
|
||||||
None => {
|
|
||||||
return Err(symphonia::core::errors::Error::Unsupported(
|
|
||||||
"No track with supported codec",
|
"No track with supported codec",
|
||||||
))
|
))?
|
||||||
}
|
.id;
|
||||||
};
|
|
||||||
|
|
||||||
let track = probed
|
let track = probed
|
||||||
.format
|
.format
|
||||||
|
|
Loading…
Reference in a new issue