diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset.cc | 5 | ||||
| -rw-r--r-- | src/sound_asset.h | 4 | ||||
| -rw-r--r-- | src/sound_asset_writer.cc | 8 | ||||
| -rw-r--r-- | src/verify.cc | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index fe0c5dd0..4f0166d8 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -63,11 +63,6 @@ using namespace dcp; SoundAsset::SoundAsset (boost::filesystem::path file) : Asset (file) - /* XXX: this is a fallback language, which will be used if we can't find the RFC5646SpokenLanguage - * in the MXF header. Perhaps RFC5646SpokenLanguage is optional and we should just not write it - * if we don't know it. - */ - , _language ("en-US") { ASDCP::PCM::MXFReader reader; auto r = reader.OpenRead (file.string().c_str()); diff --git a/src/sound_asset.h b/src/sound_asset.h index e58773e4..79edea96 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -102,7 +102,7 @@ public: return _intrinsic_duration; } - std::string language () const { + boost::optional<std::string> language () const { return _language; } @@ -126,7 +126,7 @@ private: int64_t _intrinsic_duration = 0; int _channels = 0; ///< number of channels int _sampling_rate = 0; ///< sampling rate in Hz - std::string _language; + boost::optional<std::string> _language; }; diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc index 205a45ab..0d7d2074 100644 --- a/src/sound_asset_writer.cc +++ b/src/sound_asset_writer.cc @@ -127,7 +127,9 @@ SoundAssetWriter::start () auto soundfield = new ASDCP::MXF::SoundfieldGroupLabelSubDescriptor(asdcp_smpte_dict); GenRandomValue (soundfield->MCALinkID); - soundfield->RFC5646SpokenLanguage = _asset->language(); + if (auto lang = _asset->language()) { + soundfield->RFC5646SpokenLanguage = *lang; + } const MCASoundField field = _asset->channels() > 10 ? MCASoundField::SEVEN_POINT_ONE : MCASoundField::FIVE_POINT_ONE; @@ -162,7 +164,9 @@ SoundAssetWriter::start () channel->MCAChannelID = i + 1; channel->MCATagSymbol = "ch" + channel_to_mca_id(dcp_channel, field); channel->MCATagName = channel_to_mca_name(dcp_channel, field); - channel->RFC5646SpokenLanguage = _asset->language(); + if (auto lang = _asset->language()) { + channel->RFC5646SpokenLanguage = *lang; + } channel->MCALabelDictionaryID = channel_to_mca_universal_label(dcp_channel, field, asdcp_smpte_dict); _state->mxf_writer.OP1aHeader().AddChildObject(channel); essence_descriptor->SubDescriptors.push_back(channel->InstanceUID); diff --git a/src/verify.cc b/src/verify.cc index 35ec69f8..e5743995 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -586,7 +586,9 @@ verify_main_sound_asset ( stage ("Checking sound asset metadata", asset->file()); - verify_language_tag (asset->language(), notes); + if (auto lang = asset->language()) { + verify_language_tag (*lang, notes); + } if (asset->sampling_rate() != 48000) { notes.push_back ({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_SOUND_FRAME_RATE, raw_convert<string>(asset->sampling_rate()), *asset->file()}); } |
