fix(format/stream): access fields directly

This commit is contained in:
tilpner
2023-05-24 17:22:59 +02:00
committed by Till Höppner
parent d7daebc884
commit 20aaf8422b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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();
}
}