[PATCH] nutenc: fix unstable floating-point calculations
--- libavformat/nutenc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 87a7900..8cbc7d4 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; -- 1.7.2.2
On Fri, Sep 10, 2010 at 01:50:04PM +0100, Mans Rullgard wrote:
--- libavformat/nutenc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
ok and thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Incandescent light bulbs waste a lot of energy as heat so the EU forbids them. Their replacement, compact fluorescent lamps, much more expensive, dont fit in many old lamps, flicker, contain toxic mercury, produce a fraction of the light that is claimed and in a unnatural spectrum rendering colors different than in natural light. Ah and we now need to turn the heaters up more in winter to compensate the lower wasted heat. Who wins? Not the environment, thats for sure
Michael Niedermayer <michaelni at gmx.at> writes:
On Fri, Sep 10, 2010 at 01:50:04PM +0100, Mans Rullgard wrote:
--- libavformat/nutenc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
ok and thanks
Applied. -- M?ns Rullg?rd mans at mansr.com
participants (2)
-
mans@mansr.com -
michaelni@gmx.at