Skip to content
Snippets Groups Projects
Commit 324d22b2 authored by Måns Rullgård's avatar Måns Rullgård
Browse files

nutenc: fix unstable floating-point calculations

Originally committed as revision 25095 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 535cb043
No related branches found
No related tags found
No related merge requests found
...@@ -561,11 +561,11 @@ static int write_header(AVFormatContext *s){ ...@@ -561,11 +561,11 @@ static int write_header(AVFormatContext *s){
if(j==nut->time_base_count) if(j==nut->time_base_count)
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; nut->stream[i].msb_pts_shift = 7;
else else
nut->stream[i].msb_pts_shift = 14; 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; nut->max_distance = MAX_DISTANCE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment