aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-09-10 13:16:08 +0000
committerMåns Rullgård <mans@mansr.com>2010-09-10 13:16:08 +0000
commit324d22b2b4aca3c7bfbbfff57a2ae96ac26e6e1b (patch)
tree4c98e6c2aa3e08be2be9c7321863844bda89cbd3
parent535cb0434db078488579eea5865045b13ae1516d (diff)
downloadffmpeg-324d22b2b4aca3c7bfbbfff57a2ae96ac26e6e1b.tar.gz
nutenc: fix unstable floating-point calculations
Originally committed as revision 25095 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/nutenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 87a7900b4b..8cbc7d4cc3 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -561,11 +561,11 @@ static int write_header(AVFormatContext *s){
if(j==nut->time_base_count)
nut->time_base_count++;
- if(av_q2d(time_base) >= 0.001)
+ if(INT64_C(1000) * time_base.num >= time_base.den)
nut->stream[i].msb_pts_shift = 7;
else
nut->stream[i].msb_pts_shift = 14;
- nut->stream[i].max_pts_distance= FFMAX(1/av_q2d(time_base), 1);
+ nut->stream[i].max_pts_distance= FFMAX(time_base.den, time_base.num) / time_base.num;
}
nut->max_distance = MAX_DISTANCE;