Small fixes.
[libdcp.git] / tools / dcpdiff.cc
index c2a454cf1b81d4d735f3e4aaab05cdf0cb4a36c7..6fb2317bd8b009709afd891cc35e45838964bfc8 100644 (file)
@@ -46,8 +46,9 @@ help (string n)
             << "  -V, --version                show libdcp version\n"
             << "  -h, --help                   show this help\n"
             << "  -v, --verbose                be verbose\n"
-            << "  -n, --mxf-filenames          allow differing MXF filenames\n"
             << "      --cpl-annotation-texts   allow differing CPL annotation texts\n"
+            << "      --reel-annotation-texts  allow differing reel annotation texts\n"
+            << "  -a, --annotation-texts       allow different CPL and reel annotation texts\n"
             << "  -m, --mean-pixel             maximum allowed mean pixel error (default 5)\n"
             << "  -s, --std-dev-pixel          maximum allowed standard deviation of pixel error (default 5)\n"
             << "      --key                    hexadecimal key to use to decrypt MXFs\n"
@@ -64,6 +65,7 @@ note (NoteType t, string n)
 {
        if (t == DCP_ERROR || verbose) {
                cout << " " << n << "\n";
+               cout.flush ();
        }
 }
 
@@ -105,28 +107,30 @@ main (int argc, char* argv[])
        options.max_mean_pixel_error = 5;
        options.max_std_dev_pixel_error = 5;
        options.reel_hashes_can_differ = true;
-       bool keep_going = false;
+       options.reel_annotation_texts_can_differ = false;
+       options.keep_going = false;
        bool ignore_missing_assets = false;
        optional<string> key;
-       
+
        int option_index = 0;
        while (1) {
                static struct option long_options[] = {
                        { "version", no_argument, 0, 'V'},
                        { "help", no_argument, 0, 'h'},
                        { "verbose", no_argument, 0, 'v'},
-                       { "mxf-filenames", no_argument, 0, 'n'},
                        { "mean-pixel", required_argument, 0, 'm'},
                        { "std-dev-pixel", required_argument, 0, 's'},
                        { "keep-going", no_argument, 0, 'k'},
+                       { "annotation-texts", no_argument, 0, 'a'},
                        /* From here we're using random capital letters for the short option */
                        { "ignore-missing-assets", no_argument, 0, 'A'},
                        { "cpl-annotation-texts", no_argument, 0, 'C'},
                        { "key", required_argument, 0, 'D'},
+                       { "reel-annotation-texts", no_argument, 0, 'E'},
                        { 0, 0, 0, 0 }
                };
 
-               int c = getopt_long (argc, argv, "Vhvnm:s:kACD:", long_options, &option_index);
+               int c = getopt_long (argc, argv, "Vhvm:s:kaACD:E", long_options, &option_index);
 
                if (c == -1) {
                        break;
@@ -142,9 +146,6 @@ main (int argc, char* argv[])
                case 'v':
                        verbose = true;
                        break;
-               case 'n':
-                       options.mxf_filenames_can_differ = true;
-                       break;
                case 'm':
                        options.max_mean_pixel_error = atof (optarg);
                        break;
@@ -152,7 +153,10 @@ main (int argc, char* argv[])
                        options.max_std_dev_pixel_error = atof (optarg);
                        break;
                case 'k':
-                       keep_going = true;
+                       options.keep_going = true;
+                       break;
+               case 'a':
+                       options.cpl_annotation_texts_can_differ = options.reel_annotation_texts_can_differ = true;
                        break;
                case 'A':
                        ignore_missing_assets = true;
@@ -164,6 +168,9 @@ main (int argc, char* argv[])
                case 'D':
                        key = string (optarg);
                        break;
+               case 'E':
+                       options.reel_annotation_texts_can_differ = true;
+                       break;
                }
        }
 
@@ -182,8 +189,8 @@ main (int argc, char* argv[])
                exit (EXIT_FAILURE);
        }
 
-       DCP* a = load_dcp (argv[optind], keep_going, ignore_missing_assets, key);
-       DCP* b = load_dcp (argv[optind + 1], keep_going, ignore_missing_assets, key);
+       DCP* a = load_dcp (argv[optind], options.keep_going, ignore_missing_assets, key);
+       DCP* b = load_dcp (argv[optind + 1], options.keep_going, ignore_missing_assets, key);
 
        /* I think this is just below the LSB at 16-bits (ie the 8th most significant bit at 24-bit) */
        options.max_audio_sample_error = 255;