Add Packet::time_base/set_time_base

Allows inspecting and adjusting the packet's time_base.
This commit is contained in:
Luke Street
2024-04-01 12:58:25 -06:00
parent 2ca7efd582
commit c239937c50
+12
View File
@@ -143,6 +143,18 @@ impl Packet {
self.0.dts = value.unwrap_or(AV_NOPTS_VALUE);
}
#[inline]
#[cfg(feature = "ffmpeg_5_0")]
pub fn time_base(&self) -> Rational {
self.0.time_base.into()
}
#[inline]
#[cfg(feature = "ffmpeg_5_0")]
pub fn set_time_base(&mut self, value: Rational) {
self.0.time_base = value.into();
}
#[inline]
pub fn size(&self) -> usize {
self.0.size as usize