summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-08 10:43:32 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-08 10:43:32 +0100
commitaa1a3dae4f5eee2ccf6f03a005b24242986e1626 (patch)
tree098eb4f641b27850e10d4fe7367b4decd0469419 /test
parent43515be4f21d92d66f28588bcd0dc93ee517d301 (diff)
Fix subs_in_out to support SMPTE.
Diffstat (limited to 'test')
-rw-r--r--test/subs_in_out.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/test/subs_in_out.cc b/test/subs_in_out.cc
index 2a662262..fce0bfec 100644
--- a/test/subs_in_out.cc
+++ b/test/subs_in_out.cc
@@ -18,18 +18,30 @@
*/
#include "interop_subtitle_asset.h"
+#include "smpte_subtitle_asset.h"
#include <iostream>
using namespace std;
-int main (int argc, char* argv[])
+int
+main (int argc, char* argv[])
{
- if (argc < 2) {
+ if (argc != 2) {
cerr << "Syntax: " << argv[0] << " <subtitle file>\n";
exit (EXIT_FAILURE);
}
-
- dcp::InteropSubtitleAsset s (argv[1]);
- cout << s.xml_as_string ();
+
+ try {
+ dcp::InteropSubtitleAsset sc (argv[1]);
+ cout << sc.xml_as_string ();
+ } catch (exception& e) {
+ cerr << "Could not load as interop: " << e.what() << "\n";
+ try {
+ dcp::SMPTESubtitleAsset sc (argv[1]);
+ cout << sc.xml_as_string().raw ();
+ } catch (exception& e) {
+ cerr << "Could not load as SMPTE (" << e.what() << ")\n";
+ }
+ }
return 0;
}