util/error: refactor error handling
This commit is contained in:
@ -16,7 +16,7 @@ impl Audio {
|
||||
let mut got: c_int = 0;
|
||||
|
||||
match avcodec_decode_audio4(self.ptr, out.ptr, &mut got, &packet.val) {
|
||||
e if e < 0 => Err(Error::new(e)),
|
||||
e if e < 0 => Err(Error::from(e)),
|
||||
_ => Ok(got != 0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user