diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-01 22:45:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-01 22:45:58 +0100 |
| commit | 6a18a737ef8dfbfbe909afe8266f104a2125b5fb (patch) | |
| tree | c244025af0ae2a8866f5a15941ea4055954bd3ae /src/lib/frame_rate_change.cc | |
| parent | 7a0c2256cbf94d2434ba6e7485517df0a7f894af (diff) | |
Store video frame rate in XML (#883).
Diffstat (limited to 'src/lib/frame_rate_change.cc')
| -rw-r--r-- | src/lib/frame_rate_change.cc | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/lib/frame_rate_change.cc b/src/lib/frame_rate_change.cc index 8b2d6cf99..80a167029 100644 --- a/src/lib/frame_rate_change.cc +++ b/src/lib/frame_rate_change.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,9 +18,10 @@ */ -#include <cmath> #include "frame_rate_change.h" +#include "types.h" #include "compose.hpp" +#include <cmath> #include "i18n.h" @@ -29,28 +30,7 @@ using std::string; static bool about_equal (double a, double b) { - /* A film of F seconds at f FPS will be Ff frames; - Consider some delta FPS d, so if we run the same - film at (f + d) FPS it will last F(f + d) seconds. - - Hence the difference in length over the length of the film will - be F(f + d) - Ff frames - = Ff + Fd - Ff frames - = Fd frames - = Fd/f seconds - - So if we accept a difference of 1 frame, ie 1/f seconds, we can - say that - - 1/f = Fd/f - ie 1 = Fd - ie d = 1/F - - So for a 3hr film, ie F = 3 * 60 * 60 = 10800, the acceptable - FPS error is 1/F ~= 0.0001 ~= 10-e4 - */ - - return (fabs (a - b) < 1e-4); + return (fabs (a - b) < VIDEO_FRAME_RATE_EPSILON); } |
