summaryrefslogtreecommitdiff
path: root/tools/dcpdiff.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-31 12:41:33 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-31 12:41:33 +0100
commite3636c080d3d24471e85f519d69af4c11d5ecbd0 (patch)
treef165bc8174ef9fd5668bf3667b167e8601ff9d90 /tools/dcpdiff.cc
parent32e93176fa91b215d68dee24e7887a21041da54c (diff)
Check sound; various fixups.
Diffstat (limited to 'tools/dcpdiff.cc')
-rw-r--r--tools/dcpdiff.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc
index 9dd488ed..df5eb3d0 100644
--- a/tools/dcpdiff.cc
+++ b/tools/dcpdiff.cc
@@ -1,7 +1,10 @@
+#include <boost/filesystem.hpp>
#include <getopt.h>
#include "dcp.h"
+#include "exceptions.h"
using namespace std;
+using namespace boost;
using namespace libdcp;
static void
@@ -55,15 +58,38 @@ main (int argc, char* argv[])
exit (EXIT_FAILURE);
}
- DCP a (argv[optind]);
- DCP b (argv[optind + 1]);
+ if (!filesystem::exists (argv[optind])) {
+ cerr << argv[0] << ": DCP " << argv[optind] << " not found.\n";
+ exit (EXIT_FAILURE);
+ }
+
+ if (!filesystem::exists (argv[optind + 1])) {
+ cerr << argv[0] << ": DCP " << argv[optind + 1] << " not found.\n";
+ exit (EXIT_FAILURE);
+ }
+
+ DCP* a = 0;
+ try {
+ a = new DCP (argv[optind]);
+ } catch (FileError& e) {
+ cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << " " << e.filename() << "\n";
+ exit (EXIT_FAILURE);
+ }
+
+ DCP* b = 0;
+ try {
+ b = new DCP (argv[optind + 1]);
+ } catch (FileError& e) {
+ cerr << "Could not read DCP " << argv[optind + 1] << "; " << e.what() << " " << e.filename() << "\n";
+ exit (EXIT_FAILURE);
+ }
EqualityFlags flags = EqualityFlags (LIBDCP_METADATA | MXF_INSPECT);
if (bitwise) {
flags = EqualityFlags (flags | MXF_BITWISE);
}
- list<string> notes = a.equals (b, flags);
+ list<string> notes = a->equals (*b, flags);
if (notes.empty ()) {
cout << "DCPs identical\n";
exit (EXIT_SUCCESS);