mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
fix(format/stream): access fields directly
This commit is contained in:
@@ -89,7 +89,7 @@ impl<'a> Stream<'a> {
|
||||
}
|
||||
|
||||
pub fn frame_rate(&self) -> Rational {
|
||||
unsafe { Rational::from(av_stream_get_r_frame_rate(self.as_ptr())) }
|
||||
unsafe { Rational::from((*self.as_ptr()).r_frame_rate) }
|
||||
}
|
||||
|
||||
pub fn avg_frame_rate(&self) -> Rational {
|
||||
|
||||
@@ -34,7 +34,7 @@ impl<'a> StreamMut<'a> {
|
||||
|
||||
pub fn set_rate<R: Into<Rational>>(&mut self, value: R) {
|
||||
unsafe {
|
||||
av_stream_set_r_frame_rate(self.as_mut_ptr(), value.into().into());
|
||||
(*self.as_mut_ptr()).r_frame_rate = value.into().into();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user