diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-03 12:06:49 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 21:57:18 +0200 |
| commit | 15682e0e208cf9b6286d71ad0efd78fe7118332f (patch) | |
| tree | e2b2ca114c5b81986b6a46223c72b513603d9426 /src | |
| parent | 4aad2db751489fb2f81224cc95fcce4ff306d25b (diff) | |
Accept missing MainSoundConfiguration and MainSoundSampleRate, for better or for worse.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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"), |
