From 502ee050855da2af9e73c6be8aa2f6f2d73c52f9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 6 Apr 2020 20:24:24 +0200 Subject: Fix initialisation order of constructors. --- src/MXF.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/MXF.cpp') diff --git a/src/MXF.cpp b/src/MXF.cpp index 5cab95e..1bf16ed 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -1026,8 +1026,8 @@ ASDCP::MXF::OP1aHeader::Dump(FILE* stream) // ASDCP::MXF::OPAtomIndexFooter::OPAtomIndexFooter(const Dictionary*& d) : - Partition(d), m_Dict(d), - m_CurrentSegment(0), m_BytesPerEditUnit(0), m_BodySID(0), + Partition(d), m_CurrentSegment(0), m_BytesPerEditUnit(0), + m_BodySID(0), m_Dict(d), m_ECOffset(0), m_Lookup(0) { BodySID = 0; @@ -1769,7 +1769,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label } // -ASDCP::MXF::ASDCP_MCAConfigParser::ASDCP_MCAConfigParser(const Dictionary*& d) : m_Dict(d), m_ChannelCount(0) +ASDCP::MXF::ASDCP_MCAConfigParser::ASDCP_MCAConfigParser(const Dictionary*& d) : m_ChannelCount(0), m_Dict(d) { typedef mca_label_map_t::value_type pair; m_LabelMap.insert(pair("L", label_traits("Left" , true, m_Dict->ul(MDD_DCAudioChannel_L)))); -- cgit v1.2.3 From a445d5132dbbcf27656fe47d4db277db1ae31e38 Mon Sep 17 00:00:00 2001 From: Brogan Ross Date: Thu, 28 Jan 2021 10:54:15 -0800 Subject: adding SLVS language assignment functionality --- src/MXF.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/MXF.cpp') diff --git a/src/MXF.cpp b/src/MXF.cpp index 83954f7..974f61f 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -1599,6 +1599,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label InterchangeObject_list_t& descriptor_list, ui32_t& channel_count) { std::string symbol_buf; + std::string current_language; channel_count = 0; ASDCP::MXF::SoundfieldGroupLabelSubDescriptor *current_soundfield = 0, *prev_soundfield = 0; std::string::const_iterator i; @@ -1695,6 +1696,15 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label symbol_buf.clear(); current_soundfield = 0; } + else if ( *i == ':' ) + { + // Limits the usage to the SLVS channel, but can easily be extended to set individual languages, or soundfield group languages + if ( symbol_buf.compare("SLVS") != 0 ) { + DefaultLogSink().Error("Channel specific language may only be used with SLVS tag\n"); + return false; + } + current_language += *i; + } else if ( *i == ',' ) { if ( ! symbol_buf.empty() && ! symbol_buf.compare("-") ) @@ -1730,15 +1740,35 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label channel_descr->MCAChannelID = channel_count++ + 1; channel_descr->MCATagSymbol = (i->second.requires_prefix ? "ch" : "") + i->first; channel_descr->MCATagName = i->second.tag_name; - channel_descr->RFC5646SpokenLanguage = language; + if ( current_language.empty() ) + { + channel_descr->RFC5646SpokenLanguage = language; + } + else + { + channel_descr->RFC5646SpokenLanguage = current_language; + } + current_language.empty(); channel_descr->MCALabelDictionaryID = i->second.ul; descriptor_list.push_back(reinterpret_cast(channel_descr)); symbol_buf.clear(); + current_language.clear(); } } else if ( *i == '-' || isalnum(*i) ) { - symbol_buf += *i; + if ( ! current_language.empty() ) + { + if ( current_language.compare(":") == 0) + { + current_language.clear(); + } + current_language += *i; + } + else + { + symbol_buf += *i; + } } else if ( ! isspace(*i) ) { -- cgit v1.2.3