Function rsmpeg::ffi::av_rescale_delta [−][src]
pub unsafe extern "C" fn av_rescale_delta(
in_tb: AVRational,
in_ts: i64,
fs_tb: AVRational,
duration: i32,
last: *mut i64,
out_tb: AVRational
) -> i64
Expand description
Rescale a timestamp while preserving known durations.
This function is designed to be called per audio packet to scale the input timestamp to a different time base. Compared to a simple av_rescale_q() call, this function is robust against possible inconsistent frame durations.
The last
parameter is a state variable that must be preserved for all
subsequent calls for the same stream. For the first call, *last
should be
initialized to #AV_NOPTS_VALUE.
@param[in] in_tb Input time base
@param[in] in_ts Input timestamp
@param[in] fs_tb Duration time base; typically this is finer-grained
(greater) than in_tb
and out_tb
@param[in] duration Duration till the next call to this function (i.e.
duration of the current packet/frame)
@param[in,out] last Pointer to a timestamp expressed in terms of
fs_tb
, acting as a state variable
@param[in] out_tb Output timebase
@return Timestamp expressed in terms of out_tb
@note In the context of this function, “duration” is in term of samples, not seconds.