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/image.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/image.cc')
| -rw-r--r-- | src/lib/image.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index e8622eba4..8a8fb1c7b 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -22,7 +22,6 @@ */ #include <iostream> -#include <openssl/md5.h> extern "C" { #include <libswscale/swscale.h> #include <libavutil/pixfmt.h> @@ -31,6 +30,7 @@ extern "C" { #include "image.h" #include "exceptions.h" #include "scaler.h" +#include "md5_digester.h" #include "i18n.h" @@ -629,21 +629,12 @@ Image::aligned () const string Image::digest () const { - MD5_CTX md5_context; - MD5_Init (&md5_context); + MD5Digester digester; for (int i = 0; i < components(); ++i) { - MD5_Update (&md5_context, data()[i], line_size()[i]); - } - - unsigned char digest[MD5_DIGEST_LENGTH]; - MD5_Final (digest, &md5_context); - - stringstream s; - for (int i = 0; i < MD5_DIGEST_LENGTH; ++i) { - s << std::hex << std::setfill('0') << std::setw(2) << ((int) digest[i]); + digester.add (data()[i], line_size()[i]); } - return s.str (); + return digester.get (); } |
