Commit 4956d0e5 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/mathematics/av_add_stable: check for the common case of inc=1

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 5b7519fb
......@@ -188,7 +188,8 @@ simple_round:
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
{
inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
if (inc != 1)
inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
if (av_cmp_q(inc_tb, ts_tb) < 0) {
//increase step is too small for even 1 step to be representable
......
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