util/frame: make pts return Option<i64>

This commit is contained in:
meh
2015-09-28 02:25:26 +02:00
parent 3ba84fb7ea
commit 33a116023e

View File

@ -79,9 +79,12 @@ impl Frame {
} }
} }
pub fn pts(&self) -> i64 { pub fn pts(&self) -> Option<i64> {
unsafe { unsafe {
(*self.as_ptr()).pts as i64 match (*self.as_ptr()).pts {
AV_NOPTS_VALUE => None,
pts => Some(pts as i64),
}
} }
} }