util/error: refactor error handling

This commit is contained in:
meh
2015-05-24 18:51:34 +02:00
parent 2716893612
commit 5b80b10949
13 changed files with 205 additions and 101 deletions

View File

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