codec/packet: fix pts(): return Option

This commit is contained in:
lummax
2015-08-30 22:15:20 +02:00
parent edcddc91e7
commit 3091e20f2d

View File

@ -92,8 +92,11 @@ impl Packet {
self.0.stream_index = index as c_int;
}
pub fn pts(&self) -> i64 {
self.0.pts as i64
pub fn pts(&self) -> Option<i64> {
match self.0.pts {
AV_NOPTS_VALUE => None,
pts => Some(pts as i64),
}
}
pub fn dts(&self) -> i64 {