From: jhurst Date: Mon, 23 Jul 2018 15:44:25 +0000 (+0000) Subject: o Fixed soundfield split-syntax fault (was tagging out-of-group channels with the... X-Git-Tag: rel_2_10_32~58 X-Git-Url: https://git.carlh.net/gitweb/?p=asdcplib.git;a=commitdiff_plain;h=3f512b8db277d1e5e8dc516d06a5df3fdc90723b o Fixed soundfield split-syntax fault (was tagging out-of-group channels with the LinkID) o Added asdcp.decode_mca_string() subroutine --- diff --git a/src/MXF.cpp b/src/MXF.cpp index 049953c..df53b21 100755 --- a/src/MXF.cpp +++ b/src/MXF.cpp @@ -1493,7 +1493,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label { std::string symbol_buf; channel_count = 0; - ASDCP::MXF::SoundfieldGroupLabelSubDescriptor *current_soundfield = 0; + ASDCP::MXF::SoundfieldGroupLabelSubDescriptor *current_soundfield = 0, *prev_soundfield = 0; std::string::const_iterator i; for ( i = s.begin(); i != s.end(); ++i ) @@ -1512,12 +1512,21 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label } else if ( symbol_buf.empty() ) { - DefaultLogSink().Error("Encountered '(', without leading soundfield group symbol.\n"); - return false; + if ( prev_soundfield != 0 ) + { + current_soundfield = prev_soundfield; + // appending to the existing soundfield group + continue; + } + else + { + DefaultLogSink().Error("Encountered '(', without leading soundfield group symbol.\n"); + return false; + } } mca_label_map_t::const_iterator i = labels.find(symbol_buf); - + if ( i == labels.end() ) { DefaultLogSink().Error("Unknown symbol: '%s'\n", symbol_buf.c_str()); @@ -1538,6 +1547,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label current_soundfield->RFC5646SpokenLanguage = language; current_soundfield->MCALabelDictionaryID = i->second.ul; descriptor_list.push_back(reinterpret_cast(current_soundfield)); + prev_soundfield = current_soundfield; symbol_buf.clear(); } else if ( *i == ')' ) @@ -1576,6 +1586,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label channel_descr->MCALabelDictionaryID = i->second.ul; descriptor_list.push_back(reinterpret_cast(channel_descr)); symbol_buf.clear(); + current_soundfield = 0; } else if ( *i == ',' ) {