codec/decoder: add time_base() method

This commit is contained in:
lummax 2015-09-18 21:03:15 +02:00 committed by meh
parent f15f26f706
commit 34ff7bafbf

View File

@ -24,7 +24,7 @@ use std::ops::{Deref, DerefMut};
use ffi::*;
use super::{Id, Context};
use ::{Codec, Error, Discard, Dictionary};
use ::{Codec, Error, Discard, Rational, Dictionary};
pub struct Decoder(pub Context);
@ -127,6 +127,12 @@ impl Decoder {
(*self.as_mut_ptr()).skip_frame = value.into();
}
}
pub fn time_base(&self) -> Rational {
unsafe {
Rational::from((*self.as_ptr()).time_base)
}
}
}
impl Deref for Decoder {