improved error handling pt 2

This commit is contained in:
apolunar 2024-06-06 16:29:36 -05:00
parent 5f1b057b14
commit eac5a32f3d

View file

@ -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