Merge and add option to ignore differing MXF names.
authorCarl Hetherington <cth@carlh.net>
Tue, 16 Apr 2013 08:54:23 +0000 (09:54 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 16 Apr 2013 08:54:23 +0000 (09:54 +0100)
src/mxf_asset.cc
src/types.h
tools/dcpdiff.cc

index 9b491dd735fe9d94b042a99a29ac1a1a96507d5d..144532f88afaac86dde35a5cfd21e00f2989804b 100644 (file)
@@ -71,7 +71,7 @@ MXFAsset::fill_writer_info (ASDCP::WriterInfo* writer_info, string uuid)
 }
 
 bool
-MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::function<void (NoteType, string)> note) const
+MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
        shared_ptr<const MXFAsset> other_mxf = dynamic_pointer_cast<const MXFAsset> (other);
        if (!other_mxf) {
@@ -81,7 +81,9 @@ MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::functio
        
        if (_file_name != other_mxf->_file_name) {
                note (ERROR, "MXF names differ");
-               return false;
+               if (!opt.mxf_names_can_differ) {
+                       return false;
+               }
        }
 
        if (_edit_rate != other_mxf->_edit_rate) {
index 4c824080c6727d0e36d162e3af3723ef91234009..b6372e9af339b5440a4f29b51fa435d54d1bdd19 100644 (file)
@@ -100,11 +100,13 @@ struct EqualityOptions {
                : max_mean_pixel_error (0)
                , max_std_dev_pixel_error (0)
                , max_audio_sample_error (0)
+               , mxf_names_can_differ (false)
        {}
 
        double max_mean_pixel_error;
        double max_std_dev_pixel_error;
        int max_audio_sample_error;
+       bool mxf_names_can_differ;
 };
 
 enum NoteType {
index 7913c533e22ee4b7a44384616290934fc6124c9a..6db45a1bcbeef5b4e9000e6f7f6f4ad2f0875cad 100644 (file)
@@ -17,6 +17,7 @@ help (string n)
             << "  -V, --version      show libdcp version\n"
             << "  -h, --help         show this help\n"
             << "  -v, --verbose      be verbose\n"
+            << "  -n, --names        allow differing MXF names\n"
             << "\n"
             << "The <DCP>s are the DCP directories to compare.\n"
             << "Comparison is of metadata and content, ignoring timestamps\n"
@@ -42,10 +43,11 @@ main (int argc, char* argv[])
                        { "version", no_argument, 0, 'V'},
                        { "help", no_argument, 0, 'h'},
                        { "verbose", no_argument, 0, 'v'},
+                       { "names", no_argument, 0, 'n'},
                        { 0, 0, 0, 0 }
                };
 
-               int c = getopt_long (argc, argv, "Vhv", long_options, &option_index);
+               int c = getopt_long (argc, argv, "Vhvn", long_options, &option_index);
 
                if (c == -1) {
                        break;
@@ -61,6 +63,9 @@ main (int argc, char* argv[])
                case 'v':
                        verbose = true;
                        break;
+               case 'n':
+                       options.mxf_names_can_differ = true;
+                       break;
                }
        }