Hand-apply d3bc61f0af33fedf02ac1a28cf91989ee9cd2fb6 from master;
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Dec 2014 10:37:15 +0000 (10:37 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Dec 2014 10:37:15 +0000 (10:37 +0000)
make digest optional.

TO_PORT
src/lib/audio_content.cc
src/lib/content.cc
src/lib/content.h
src/lib/ffmpeg_content.cc

diff --git a/TO_PORT b/TO_PORT
index b682332a8486dbb57fb0df2476a50e33e4eaa9d6..d47d85b5e6f6bdc4424ae02e432041c5a30fa6b4 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,2 +1 @@
-cd0b7dd044d5b5b1c05118a58c58458edb80bf61
 d609c88438d8110569cc940ea2e1bc78c0bb5acc
index 988090bf82961442c5590347d62579fe64b81035..8458e3314c7be41b36aaccfdb8fdde437fe7b8da 100644 (file)
@@ -181,7 +181,7 @@ AudioContent::audio_analysis_path () const
        }
 
        boost::filesystem::path p = film->audio_analysis_dir ();
-       p /= digest() + "_" + audio_mapping().digest();
+       p /= digest().get_value_or ("X") + "_" + audio_mapping().digest();
        return p;
 }
 
index 6e02183233da9f6f288794d61de2835bc439c8d1..ec16b961015ee19a8eb6d1b487e297879adf53e5 100644 (file)
@@ -89,7 +89,7 @@ Content::Content (shared_ptr<const Film> f, cxml::ConstNodePtr node)
        for (list<cxml::NodePtr>::const_iterator i = path_children.begin(); i != path_children.end(); ++i) {
                _paths.push_back ((*i)->content ());
        }
-       _digest = node->string_child ("Digest");
+       _digest = node->optional_string_child ("Digest");
        _position = DCPTime (node->number_child<double> ("Position"));
        _trim_start = DCPTime (node->number_child<double> ("TrimStart"));
        _trim_end = DCPTime (node->number_child<double> ("TrimEnd"));
@@ -125,7 +125,9 @@ Content::as_xml (xmlpp::Node* node) const
        for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
                node->add_child("Path")->add_child_text (i->string ());
        }
-       node->add_child("Digest")->add_child_text (_digest);
+       if (_digest) {
+               node->add_child("Digest")->add_child_text (_digest.get ());
+       }
        node->add_child("Position")->add_child_text (raw_convert<string> (_position.get ()));
        node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start.get ()));
        node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end.get ()));
index 0b72ada9c52a55d7b822829dce94ceeac134f24c..c2841b64ee3f02ec28439312f93d4833b09aad52 100644 (file)
@@ -110,7 +110,7 @@ public:
        bool paths_valid () const;
 
        /** @return MD5 digest of the content's file(s) */
-       std::string digest () const {
+       boost::optional<std::string> digest () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _digest;
        }
@@ -169,7 +169,7 @@ protected:
        std::vector<boost::filesystem::path> _paths;
        
 private:
-       std::string _digest;
+       boost::optional<std::string> _digest;
        DCPTime _position;
        DCPTime _trim_start;
        DCPTime _trim_end;
index a186db48eaecff51d6f0f1b6fa59f508378ab5ed..e09e710417755a2701eeb53e296c5c8323514505 100644 (file)
@@ -382,7 +382,7 @@ FFmpegContent::audio_analysis_path () const
        */
 
        boost::filesystem::path p = film->audio_analysis_dir ();
-       string name = digest ();
+       string name = digest().get_value_or ("X");
        if (audio_stream ()) {
                name += "_" + audio_stream()->identifier ();
        }