summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-03 12:06:49 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-20 19:32:42 +0200
commita35149d821d03a08fa8d37a8cc8b956357549901 (patch)
tree831ae8816457a7bb9e6fac42580dff0aa86064ef /src/cpl.cc
parenta91330b464995a08bdc9c9e38547f71316a06e2b (diff)
Accept missing MainSoundConfiguration and MainSoundSampleRate, for better or for worse.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 8285f87e..494f53be 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -247,13 +247,15 @@ CPL::read_composition_metadata_asset (cxml::ConstNodePtr node)
_luminance = Luminance (lum);
}
- _main_sound_configuration = node->string_child("MainSoundConfiguration");
+ _main_sound_configuration = node->optional_string_child("MainSoundConfiguration");
- string sr = node->string_child("MainSoundSampleRate");
- vector<string> sr_bits;
- boost::split (sr_bits, sr, boost::is_any_of(" "));
- DCP_ASSERT (sr_bits.size() == 2);
- _main_sound_sample_rate = raw_convert<int>(sr_bits[0]);
+ optional<string> sr = node->optional_string_child("MainSoundSampleRate");
+ if (sr) {
+ vector<string> sr_bits;
+ boost::split (sr_bits, *sr, boost::is_any_of(" "));
+ DCP_ASSERT (sr_bits.size() == 2);
+ _main_sound_sample_rate = raw_convert<int>(sr_bits[0]);
+ }
_main_picture_stored_area = dcp::Size (
node->node_child("MainPictureStoredArea")->number_child<int>("Width"),