Skip to content

Commit

Permalink
SLVS has a weird UL and was not being recognized as a channel label
Browse files Browse the repository at this point in the history
  • Loading branch information
jhursty committed Feb 20, 2020
1 parent 7f8e4c2 commit 719f213
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions src/MXF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,35 @@ ASDCP::MXF::CreateObject(const Dictionary*& Dict, const UL& label)

//------------------------------------------------------------------------------------------

//
static bool
ul_is_an_mca_group(const ASDCP::UL& ul)
{
if ( ul.Value()[10] == 2 ) // magic depends on UL "Essence Facet" byte (see ST 428-12)
{
return true;
}

return false;
}

//
static bool
ul_is_an_mca_channel(const ASDCP::UL& ul)
{
if ( ul.Value()[10] == 1 ) // magic depends on UL "Essence Facet" byte (see ST 428-12)
{
return true;
}

if ( ul == ASDCP::DefaultSMPTEDict().ul(ASDCP::MDD_AudioChannelSLVS) ) // not all ULs obey ST 428-12!
{
return true;
}

return false;
}

//
bool
ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& labels, const Dictionary*& dict, const std::string& language,
Expand Down Expand Up @@ -1592,7 +1621,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label
return false;
}

if ( i->second.ul.Value()[10] != 2 ) // magic depends on UL "Essence Facet" byte (see ST 428-12)
if ( ! ul_is_an_mca_group(i->second.ul) )
{
DefaultLogSink().Error("Not a soundfield group symbol: '%s'\n", symbol_buf.c_str());
return false;
Expand Down Expand Up @@ -1664,7 +1693,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label
return false;
}

if ( i->second.ul.Value()[10] != 1 ) // magic depends on UL "Essence Facet" byte (see ST 428-12)
if ( ! ul_is_an_mca_channel(i->second.ul) )
{
DefaultLogSink().Error("Not a channel symbol: '%s'\n", symbol_buf.c_str());
return false;
Expand Down

0 comments on commit 719f213

Please sign in to comment.