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.
@paramin in_tb Input time base
@paramin in_ts Input timestamp
@paramin fs_tb Duration time base; typically this is finer-grained
(greater) than in_tb and out_tb
@paramin 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
@paramin 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.
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.
@paramin in_tb Input time base @paramin in_ts Input timestamp @paramin fs_tb Duration time base; typically this is finer-grained (greater) than in_tb and out_tb @paramin 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 @paramin 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.