From f2fc59f25d7fa7a0710f2c9e814babfe5f0f85f9 Mon Sep 17 00:00:00 2001 From: lummax Date: Wed, 26 Aug 2015 10:29:37 +0200 Subject: [PATCH] codec/packet: add `rescale_ts()` method --- src/codec/packet/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/codec/packet/mod.rs b/src/codec/packet/mod.rs index c22dd91..0ec18b9 100644 --- a/src/codec/packet/mod.rs +++ b/src/codec/packet/mod.rs @@ -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(&mut self, source: S, destination: D) + where S: Into, + D: Into + { + 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) }