diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-02 18:02:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-02 18:02:27 +0200 |
commit | 4956d0e5a6a555d31345c913485bcc4e0a53481e (patch) | |
tree | 3e5fdca053bc95637433bc13f741ca90e8059406 /libavutil | |
parent | 5b7519fbaa8f6406d9d796de809ff3bc22060836 (diff) | |
download | ffmpeg-4956d0e5a6a555d31345c913485bcc4e0a53481e.tar.gz |
avutil/mathematics/av_add_stable: check for the common case of inc=1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/mathematics.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c index 48373bf759..c8f1e1cd89 100644 --- a/libavutil/mathematics.c +++ b/libavutil/mathematics.c @@ -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 |