diff mbox

[FFmpeg-devel] avformat/utils: always av_reduce r_frame_rate

Message ID 20170816222219.13345-1-cus@passwd.hu
State Accepted
Commit 7160992431b029b31bf407443faeaba86dc755a3
Headers show

Commit Message

Marton Balint Aug. 16, 2017, 10:22 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Aug. 17, 2017, 2:22 a.m. UTC | #1
On Thu, Aug 17, 2017 at 12:22:19AM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/utils.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

LGTM

thx

[...]
Marton Balint Aug. 17, 2017, 7:56 p.m. UTC | #2
On Thu, 17 Aug 2017, Michael Niedermayer wrote:

> On Thu, Aug 17, 2017 at 12:22:19AM +0200, Marton Balint wrote:
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/utils.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> LGTM

Thanks, appiled.

Regards,
Marton
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 58283616dc..23865c88c4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3943,8 +3943,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
             if (!st->r_frame_rate.num) {
                 if (    avctx->time_base.den * (int64_t) st->time_base.num
                     <= avctx->time_base.num * avctx->ticks_per_frame * (int64_t) st->time_base.den) {
-                    st->r_frame_rate.num = avctx->time_base.den;
-                    st->r_frame_rate.den = avctx->time_base.num * avctx->ticks_per_frame;
+                    av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
+                              avctx->time_base.den, (int64_t)avctx->time_base.num * avctx->ticks_per_frame, INT_MAX);
                 } else {
                     st->r_frame_rate.num = st->time_base.den;
                     st->r_frame_rate.den = st->time_base.num;