Use content digest for audio maps, not file name.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Apr 2013 19:52:47 +0000 (20:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Apr 2013 19:52:47 +0000 (20:52 +0100)
src/lib/audio_mapping.cc

index 2e807756566ec31a068437b99ec7038117f75880..83c748f1aada87d374894d3cb9ff5d1d31c4dca0 100644 (file)
@@ -94,7 +94,7 @@ AudioMapping::as_xml (xmlpp::Node* node) const
        for (list<pair<Channel, libdcp::Channel> >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) {
                xmlpp::Node* t = node->add_child ("Map");
                shared_ptr<const AudioContent> c = i->first.content.lock ();
-               t->add_child ("Content")->add_child_text (c->file().string ());
+               t->add_child ("Content")->add_child_text (c->digest ());
                t->add_child ("ContentIndex")->add_child_text (lexical_cast<string> (i->first.index));
                t->add_child ("DCP")->add_child_text (lexical_cast<string> (i->second));
        }
@@ -107,7 +107,7 @@ AudioMapping::set_from_xml (ContentList const & content, shared_ptr<const cxml::
        for (list<shared_ptr<cxml::Node> >::const_iterator i = c.begin(); i != c.end(); ++i) {
                string const c = (*i)->string_child ("Content");
                ContentList::const_iterator j = content.begin ();
-               while (j != content.end() && (*j)->file().string() != c) {
+               while (j != content.end() && (*j)->digest() != c) {
                        ++j;
                }