Ignore Language tag in subtitles. Get MXF/XML filenames from the asset map.
[libdcp.git] / src / asset_map.cc
index 3af2d6f8df4cd4e1b5c3bf9f56ac3f766784560b..31809c9b0a71a01d9230fc06298a6e9d65cfe5f5 100644 (file)
@@ -24,6 +24,7 @@
 #include "asset_map.h"
 
 using namespace std;
+using namespace boost;
 using namespace libdcp;
 
 AssetMap::AssetMap (string file)
@@ -54,3 +55,14 @@ Chunk::Chunk (xmlpp::Node const * node)
        length = optional_int64_node ("Length");
 }
 
+shared_ptr<AssetMapAsset>
+AssetMap::asset_from_id (string id) const
+{
+       for (list<shared_ptr<AssetMapAsset> >::const_iterator i = assets.begin (); i != assets.end(); ++i) {
+               if ((*i)->id == id) {
+                       return *i;
+               }
+       }
+
+       return shared_ptr<AssetMapAsset> ();
+}