Commit 5b7519fb authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/mathematics/av_add_stable: avoid unneeded variable

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6f6edfe1
......@@ -188,14 +188,14 @@ simple_round:
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
{
AVRational step = av_mul_q(inc_tb, (AVRational) {inc, 1});
inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
if (av_cmp_q(step, ts_tb) < 0) {
if (av_cmp_q(inc_tb, ts_tb) < 0) {
//increase step is too small for even 1 step to be representable
return ts;
} else {
int64_t old = av_rescale_q(ts, ts_tb, step);
int64_t old_ts = av_rescale_q(old, step, ts_tb);
return av_rescale_q(old + 1, step, ts_tb) + (ts - old_ts);
int64_t old = av_rescale_q(ts, ts_tb, inc_tb);
int64_t old_ts = av_rescale_q(old, inc_tb, ts_tb);
return av_rescale_q(old + 1, inc_tb, ts_tb) + (ts - old_ts);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment