aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-10-09 02:42:57 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-10-10 00:58:16 +0200
commit21bffa93a6fc73e1f1859f8bc224409eaaf27658 (patch)
tree81b8ec417fb7bc97e56250ab36c2c131c8cf5e3a /libavformat/movenc.c
parent987690799dd86433bf98b897aaa4c8d93ade646d (diff)
downloadffmpeg-21bffa93a6fc73e1f1859f8bc224409eaaf27658.tar.gz
avformat/movenc: Switch mov_write_uuidprof_tag() to avg_frame_rate
Using the stream timebase simply overflows Fix integer overflow in psp framerate computation Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8b4aa5fbe2..2c155eb8b6 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4267,8 +4267,7 @@ static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
AVCodecParameters *video_par = s->streams[0]->codecpar;
AVCodecParameters *audio_par = s->streams[1]->codecpar;
int audio_rate = audio_par->sample_rate;
- // TODO: should be avg_frame_rate
- int frame_rate = ((video_st->time_base.den) * (0x10000)) / (video_st->time_base.num);
+ int64_t frame_rate = (video_st->avg_frame_rate.num * 0x10000LL) / video_st->avg_frame_rate.den;
int audio_kbitrate = audio_par->bit_rate / 1000;
int video_kbitrate = FFMIN(video_par->bit_rate / 1000, 800 - audio_kbitrate);