mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
codec/decoder: add time_base() method
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user