diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-11-04 14:52:43 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-11-04 14:52:43 +0000 |
| commit | d9f9938c2ca2a1f9b27a85bf64a50d7f480f969b (patch) | |
| tree | 5a3c0abf1813983324e57c896deff490055d311e /src/lib/util.cc | |
| parent | b4dd5979b6c1d48b0af4fefd9d1df4e9947da402 (diff) | |
| parent | c366d41af080b9ac37117a9b27a249722c77f74e (diff) | |
Merge master.
Diffstat (limited to 'src/lib/util.cc')
| -rw-r--r-- | src/lib/util.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index b68f7e392..d89ebd0d5 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -374,6 +374,24 @@ md5_digest (string file) return s.str (); } +DCPFrameRate +dcp_frame_rate (float fps) +{ + DCPFrameRate dfr; + + dfr.run_fast = (fps != rint (fps)); + dfr.frames_per_second = rint (fps); + dfr.skip = 1; + + /* XXX: somewhat arbitrary */ + if (fps == 50) { + dfr.frames_per_second = 25; + dfr.skip = 2; + } + + return dfr; +} + /** @param An arbitrary sampling rate. * @return The appropriate DCP-approved sampling rate (48kHz or 96kHz). */ |
