mirror of
https://github.com/RustAudio/rodio
synced 2024-12-12 13:12:30 +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
|
||||
let track_id = match probed
|
||||
let track_id = probed
|
||||
.format
|
||||
.tracks()
|
||||
.iter()
|
||||
.find(|t| t.codec_params.codec != CODEC_TYPE_NULL)
|
||||
{
|
||||
Some(track) => track.id,
|
||||
None => {
|
||||
return Err(symphonia::core::errors::Error::Unsupported(
|
||||
"No track with supported codec",
|
||||
))
|
||||
}
|
||||
};
|
||||
.ok_or(symphonia::core::errors::Error::Unsupported(
|
||||
"No track with supported codec",
|
||||
))?
|
||||
.id;
|
||||
|
||||
let track = probed
|
||||
.format
|
||||
|
|
Loading…
Reference in a new issue