mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
codec/packet: add rescale_ts() method
This commit is contained in:
+10
-1
@@ -9,7 +9,7 @@ use std::mem;
|
||||
|
||||
use libc::c_int;
|
||||
use ffi::*;
|
||||
use ::{Error, format};
|
||||
use ::{Error, Rational, format};
|
||||
|
||||
pub struct Packet(AVPacket);
|
||||
|
||||
@@ -59,6 +59,15 @@ impl Packet {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn rescale_ts<S, D>(&mut self, source: S, destination: D)
|
||||
where S: Into<Rational>,
|
||||
D: Into<Rational>
|
||||
{
|
||||
unsafe {
|
||||
av_packet_rescale_ts(self.as_mut_ptr(), source.into().into(), destination.into().into());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn flags(&self) -> Flags {
|
||||
Flags::from_bits_truncate(self.0.flags)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user