util: fix code style
This commit is contained in:
parent
62739b803d
commit
1dd672546d
@ -299,13 +299,10 @@ unsafe impl Sync for Descriptor {}
|
|||||||
|
|
||||||
impl Pixel {
|
impl Pixel {
|
||||||
pub fn descriptor(self) -> Option<Descriptor> {
|
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() {
|
ptr.as_ref().map(|ptr| Descriptor { ptr })
|
||||||
None
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Some(Descriptor { ptr })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,12 +256,11 @@ impl Video {
|
|||||||
return self.height();
|
return self.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.format().descriptor() {
|
if let Some(desc) = self.format().descriptor() {
|
||||||
None => self.height(),
|
let s = desc.log2_chroma_h();
|
||||||
Some(desc) => {
|
(self.height() + (1 << s) - 1) >> s
|
||||||
let s = desc.log2_chroma_h();
|
} else {
|
||||||
(self.height() + (1 << s) - 1) >> s
|
self.height()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user