Add SoundAsset::valid_mxf().
authorCarl Hetherington <cth@carlh.net>
Sun, 28 Feb 2016 19:39:14 +0000 (19:39 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 28 Feb 2016 19:39:14 +0000 (19:39 +0000)
src/sound_asset.cc
src/sound_asset.h

index f95b860f7da2bd0efaab38e72ca1a06a7be9cee5..b9be77c866f73efdf68a6b6b35a17a0dd96074fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -178,3 +178,11 @@ SoundAsset::pkl_type (Standard standard) const
                DCP_ASSERT (false);
        }
 }
+
+bool
+SoundAsset::valid_mxf (boost::filesystem::path file)
+{
+       ASDCP::PCM::MXFReader reader;
+       Kumu::Result_t r = reader.OpenRead (file.string().c_str ());
+       return !ASDCP_FAILURE (r);
+}
index 968f7dded8033ee474f308199bb60afefba8b6d5..73734f9fa67ce5a0ac4209ce19a8836343d2c34a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -71,6 +71,8 @@ public:
                return _intrinsic_duration;
        }
 
+       static bool valid_mxf (boost::filesystem::path);
+
 private:
        friend class SoundAssetWriter;