projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix build with newer FFmpeg.
[dcpomatic.git]
/
src
/
lib
/
util.h
diff --git
a/src/lib/util.h
b/src/lib/util.h
index fa0d9fdf2383d778d8ffe18e0961f6788609e209..013eabe120678c415f28e176a115ed729a12eae3 100644
(file)
--- a/
src/lib/util.h
+++ b/
src/lib/util.h
@@
-150,4
+150,12
@@
list_to_vector (std::list<T> v)
extern double db_to_linear (double db);
extern double linear_to_db (double linear);
+
+template <class T>
+T clamp (T val, T minimum, T maximum)
+{
+ return std::max(std::min(val, maximum), minimum);
+}
+
+
#endif