summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-02-28 19:39:14 +0000
committerCarl Hetherington <cth@carlh.net>2016-02-28 19:39:14 +0000
commitc9717810952874f38c58b526abf4875abf38534c (patch)
tree49c049fb85a1efe69bcddceae9f8f10198634d5a /src
parentc009f6795d133e8dfe0662042e0b3c90dde0e25b (diff)
Add SoundAsset::valid_mxf().
Diffstat (limited to 'src')
-rw-r--r--src/sound_asset.cc10
-rw-r--r--src/sound_asset.h4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index f95b860f..b9be77c8 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -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);
+}
diff --git a/src/sound_asset.h b/src/sound_asset.h
index 968f7dde..73734f9f 100644
--- a/src/sound_asset.h
+++ b/src/sound_asset.h
@@ -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;