diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-09-29 10:20:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-09-29 10:20:50 +0100 |
| commit | 5dacabb5bf3372107e032f3a90555c3c7f9cb6a7 (patch) | |
| tree | 7c9325c3a4e6d3fcbc15a9396e8be0ae5dc9d3d7 /src/lib/dcpomatic_time.h | |
| parent | b08f08eadf8692202af93e385de93b210b7cd5f4 (diff) | |
Make sure we round properly when deciding how many audio frames to discard.
Diffstat (limited to 'src/lib/dcpomatic_time.h')
| -rw-r--r-- | src/lib/dcpomatic_time.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index 7d755a46c..a5a0684e5 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -140,6 +140,11 @@ public: return floor (_t * r / HZ); } + template <typename T> + int64_t frames_ceil (T r) const { + return ceil (_t * r / HZ); + } + /** @param r Frames per second */ template <typename T> void split (T r, int& h, int& m, int& s, int& f) const |
