Commit 21bffa93 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 98769079
......@@ -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);
......
c4b2503a069fecd2f82704decf285160 *tests/data/fate/copy-psp.psp
6889223644fc560069c8591984175a62 *tests/data/fate/copy-psp.psp
2041379 tests/data/fate/copy-psp.psp
#extradata 0: 51, 0xaf6d1012
#extradata 1: 2, 0x00b200a1
......
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