aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msmpeg4enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-12 10:34:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-12 11:36:17 +0200
commit9e938d22c547654fcc19864f568288342ae2f3be (patch)
tree3768b03799ff21ac1e5255c25fb77162b491dc9a /libavcodec/msmpeg4enc.c
parent75b38674b6346da894f025a4b3f1cd2a468353bc (diff)
downloadffmpeg-9e938d22c547654fcc19864f568288342ae2f3be.tar.gz
msmpeg4enc: fix stored fps value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msmpeg4enc.c')
-rw-r--r--libavcodec/msmpeg4enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 527d2840e1..db9eaabfa7 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -275,7 +275,8 @@ void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
void ff_msmpeg4_encode_ext_header(MpegEncContext * s)
{
- put_bits(&s->pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
+ unsigned fps = s->avctx->time_base.den / s->avctx->time_base.num / FFMAX(s->avctx->ticks_per_frame, 1);
+ put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29
put_bits(&s->pb, 11, FFMIN(s->bit_rate/1024, 2047));