diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-03 14:30:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-03 14:30:42 +0100 |
| commit | c5b3d91fab31fde4c21e1cc5bb5adb1d6d26fcca (patch) | |
| tree | a88349c4c4e6e8304d92161529a5ca3dc5271a7b /src/lib/audio_mapping.cc | |
| parent | fd26b3243015824bebe8ec41c6b4a0d81748e81a (diff) | |
Include audio mapping in the digest used to distinguish different
audio analyses so that the analyses are re-computed when the mapping
changes.
Reported-by: Matthias Damm
Diffstat (limited to 'src/lib/audio_mapping.cc')
| -rw-r--r-- | src/lib/audio_mapping.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc index b1810c973..e35c1ae94 100644 --- a/src/lib/audio_mapping.cc +++ b/src/lib/audio_mapping.cc @@ -22,6 +22,7 @@ #include <libdcp/raw_convert.h> #include "audio_mapping.h" #include "util.h" +#include "md5_digester.h" using std::list; using std::cout; @@ -126,3 +127,20 @@ AudioMapping::as_xml (xmlpp::Node* node) const } } } + +/** @return a string which is unique for a given AudioMapping configuration, for + * differentiation between different AudioMappings. + */ +string +AudioMapping::digest () const +{ + MD5Digester digester; + digester.add (_content_channels); + for (int i = 0; i < _content_channels; ++i) { + for (int j = 0; j < MAX_DCP_AUDIO_CHANNELS; ++j) { + digester.add (_gain[i][j]); + } + } + + return digester.get (); +} |
