util: fix code style

This commit is contained in:
Ivan Molodetskikh 2017-06-20 20:47:11 +03:00 committed by meh
parent 62739b803d
commit 1dd672546d
2 changed files with 8 additions and 12 deletions

View File

@ -299,13 +299,10 @@ unsafe impl Sync for Descriptor {}
impl Pixel {
pub fn descriptor(self) -> Option<Descriptor> {
let ptr = unsafe { av_pix_fmt_desc_get(self.into()) };
unsafe {
let ptr = av_pix_fmt_desc_get(self.into());
if ptr.is_null() {
None
}
else {
Some(Descriptor { ptr })
ptr.as_ref().map(|ptr| Descriptor { ptr })
}
}
}

View File

@ -256,12 +256,11 @@ impl Video {
return self.height();
}
match self.format().descriptor() {
None => self.height(),
Some(desc) => {
if let Some(desc) = self.format().descriptor() {
let s = desc.log2_chroma_h();
(self.height() + (1 << s) - 1) >> s
}
} else {
self.height()
}
}