aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-18 17:21:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-18 17:27:06 +0200
commitbd148ce07de08dcd03178e869bacf1e1ef6358df (patch)
treefb5513ff5954e85e1187f8d87a9155e920929a35
parentdaa7bccad2279d43e7173dba0174c2052a65a51f (diff)
parentcfbdd7ffbd9fe14d110fd1bb89bf52f0f7bde016 (diff)
downloadffmpeg-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.c7
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;
}
}