diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-18 17:21:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-18 17:27:06 +0200 |
commit | bd148ce07de08dcd03178e869bacf1e1ef6358df (patch) | |
tree | fb5513ff5954e85e1187f8d87a9155e920929a35 | |
parent | daa7bccad2279d43e7173dba0174c2052a65a51f (diff) | |
parent | cfbdd7ffbd9fe14d110fd1bb89bf52f0f7bde016 (diff) | |
download | ffmpeg-bd148ce07de08dcd03178e869bacf1e1ef6358df.tar.gz |
Merge commit 'cfbdd7ffbd9fe14d110fd1bb89bf52f0f7bde016'
* commit 'cfbdd7ffbd9fe14d110fd1bb89bf52f0f7bde016':
rtpenc: base max_frames_per_packet on avg_frame_rate, not codec timebase
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/rtpenc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index bf9c245161..e7527c774a 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -168,7 +168,12 @@ static int rtp_write_header(AVFormatContext *s1) } if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { /* FIXME: We should round down here... */ - s->max_frames_per_packet = av_rescale_q(s1->max_delay, (AVRational){1, 1000000}, st->codec->time_base); + if (st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0) { + s->max_frames_per_packet = av_rescale_q(s1->max_delay, + (AVRational){1, 1000000}, + av_inv_q(st->avg_frame_rate)); + } else + s->max_frames_per_packet = 1; } } |