codec/packet: add rescale_ts()
method
This commit is contained in:
parent
40c13a7238
commit
f2fc59f25d
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user