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

@ -15,7 +15,7 @@ impl Audio {
let mut got: c_int = 0;
match avcodec_encode_audio2(self.ptr, &mut out.val, frame.ptr, &mut got) {
e if e < 0 => Err(Error::new(e)),
e if e < 0 => Err(Error::from(e)),
_ => Ok(got != 0)
}
}