util: fix code style
This commit is contained in:
parent
62739b803d
commit
1dd672546d
@ -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 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user