diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-08 10:43:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-08 10:43:32 +0100 |
| commit | aa1a3dae4f5eee2ccf6f03a005b24242986e1626 (patch) | |
| tree | 098eb4f641b27850e10d4fe7367b4decd0469419 /test | |
| parent | 43515be4f21d92d66f28588bcd0dc93ee517d301 (diff) | |
Fix subs_in_out to support SMPTE.
Diffstat (limited to 'test')
| -rw-r--r-- | test/subs_in_out.cc | 22 |
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; } |
