Be more careful about allowing possibly-trouble-causing characters in DCP filenames.
[dcpomatic.git] / src / lib / film.cc
index 79eb313ce44de451e37184094e92454e2b492085..dd31388b6fd7adf58210cd49fa72e3432822830e 100644 (file)
@@ -791,24 +791,10 @@ Film::dcp_name (bool if_created_now) const
 {
        string unfiltered;
        if (use_isdcf_name()) {
-               unfiltered = isdcf_name (if_created_now);
-       } else {
-               unfiltered = name ();
-       }
-
-       /* Filter out `bad' characters which cause problems with some systems.
-          There's no apparent list of what really is allowed, so this is a guess.
-       */
-
-       string filtered;
-       string const allowed = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
-       for (size_t i = 0; i < unfiltered.size(); ++i) {
-               if (allowed.find (unfiltered[i]) != string::npos) {
-                       filtered += unfiltered[i];
-               }
+               return careful_string_filter (isdcf_name (if_created_now));
        }
 
-       return filtered;
+       return careful_string_filter (name ());
 }
 
 void
@@ -1260,6 +1246,7 @@ Film::make_kdm (
                bool done = false;
                BOOST_FOREACH (dcp::DecryptedKDMKey j, imported_keys) {
                        if (j.id() == mxf->key_id().get()) {
+                               LOG_GENERAL ("Using imported key for %1", mxf->key_id().get());
                                keys[mxf] = j.key();
                                done = true;
                        }
@@ -1267,6 +1254,7 @@ Film::make_kdm (
 
                if (!done) {
                        /* No imported key; it must be an asset that we encrypted */
+                       LOG_GENERAL ("Using our own key for %1", mxf->key_id().get());
                        keys[mxf] = key();
                }
        }