Fix problems with FFmpeg files that have all-zero stream IDs.
[dcpomatic.git] / src / lib / config.cc
index 777d4114d9c3b9fcfaf14bb46bbe20ecd64a8347..54b9168f2542a1bbd8ee49d0b933f4c95007ada2 100644 (file)
@@ -41,7 +41,6 @@
 using std::vector;
 using std::ifstream;
 using std::string;
-using std::ofstream;
 using std::list;
 using std::max;
 using std::exception;
@@ -109,8 +108,8 @@ Config::read ()
        boost::optional<bool> u = f.optional_bool_child ("UseAnyServers");
        _use_any_servers = u.get_value_or (true);
 
-       list<shared_ptr<cxml::Node> > servers = f.node_children ("Server");
-       for (list<shared_ptr<cxml::Node> >::iterator i = servers.begin(); i != servers.end(); ++i) {
+       list<cxml::NodePtr> servers = f.node_children ("Server");
+       for (list<cxml::NodePtr>::iterator i = servers.begin(); i != servers.end(); ++i) {
                if ((*i)->node_children("HostName").size() == 1) {
                        _servers.push_back ((*i)->string_child ("HostName"));
                } else {
@@ -147,13 +146,13 @@ Config::read ()
        _default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or (10);
        _default_j2k_bandwidth = f.optional_number_child<int>("DefaultJ2KBandwidth").get_value_or (200000000);
 
-       list<shared_ptr<cxml::Node> > cc = f.node_children ("ColourConversion");
+       list<cxml::NodePtr> cc = f.node_children ("ColourConversion");
 
        if (!cc.empty ()) {
                _colour_conversions.clear ();
        }
        
-       for (list<shared_ptr<cxml::Node> >::iterator i = cc.begin(); i != cc.end(); ++i) {
+       for (list<cxml::NodePtr>::iterator i = cc.begin(); i != cc.end(); ++i) {
                _colour_conversions.push_back (PresetColourConversion (*i));
        }
 
@@ -164,8 +163,8 @@ Config::read ()
                _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, libdcp::colour_matrix::rec709_to_xyz, 2.6));
        }
 
-       list<shared_ptr<cxml::Node> > cin = f.node_children ("Cinema");
-       for (list<shared_ptr<cxml::Node> >::iterator i = cin.begin(); i != cin.end(); ++i) {
+       list<cxml::NodePtr> cin = f.node_children ("Cinema");
+       for (list<cxml::NodePtr>::iterator i = cin.begin(); i != cin.end(); ++i) {
                /* Slightly grotty two-part construction of Cinema here so that we can use
                   shared_from_this.
                */
@@ -182,6 +181,7 @@ Config::read ()
 void
 Config::read_old_metadata ()
 {
+       /* XXX: this won't work with non-Latin filenames */
        ifstream f (file(true).string().c_str ());
        string line;