diff options
| author | jhurst <jhurst@cinecert.com> | 2018-10-13 21:49:53 +0000 |
|---|---|---|
| committer | jhurst <> | 2018-10-13 21:49:53 +0000 |
| commit | d0f88650a6395b4ee67c18e21a18ee341e7cd130 (patch) | |
| tree | 5b575d1839259df2cf1a5b0fddcc2ff00cb46352 /src/Dict.cpp | |
| parent | 2d8ed1812b98fe0af65fccf2e1565e724a93d701 (diff) | |
Fixed Atmos DataEssenceCoding UL
Diffstat (limited to 'src/Dict.cpp')
| -rwxr-xr-x | src/Dict.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/Dict.cpp b/src/Dict.cpp index fbf76b0..752b81a 100755 --- a/src/Dict.cpp +++ b/src/Dict.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2006-2016, John Hurst +Copyright (c) 2006-2018, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -136,6 +136,38 @@ ASDCP::SMPTE_390_OPAtom_Entry() { return s_MDD_Table[MDD_OPAtom]; } +// +// +static ASDCP::Dictionary s_AtmosSMPTEDict; +static Kumu::Mutex s_AtmosSMPTEDictLock; +static bool s_AtmosSMPTEDictInit = false; + +// +const ASDCP::Dictionary& +ASDCP::AtmosSMPTEDict() +{ + if ( ! s_AtmosSMPTEDictInit ) + { + Kumu::AutoMutex AL(s_AtmosSMPTEDictLock); + + if ( ! s_AtmosSMPTEDictInit ) + { + s_AtmosSMPTEDict.Init(); + + s_AtmosSMPTEDict.DeleteEntry(MDD_MXFInterop_OPAtom); + s_AtmosSMPTEDict.DeleteEntry(MDD_MXFInterop_CryptEssence); + s_AtmosSMPTEDict.DeleteEntry(MDD_MXFInterop_GenericDescriptor_SubDescriptors); + + // legacy Atmos files have the wrong version byte + assert(s_AtmosSMPTEDict.Type(MDD_GenericDataEssenceDescriptor_DataEssenceCoding).ul[7] == 0x03); + s_AtmosSMPTEDict.MutableType(MDD_GenericDataEssenceDescriptor_DataEssenceCoding).ul[7] = 0x05; + + s_AtmosSMPTEDictInit = true; + } + } + + return s_AtmosSMPTEDict; +} //------------------------------------------------------------------------------------------ // @@ -253,6 +285,19 @@ ASDCP::Dictionary::Type(MDD_t type_id) const } // +ASDCP::MDDEntry& +ASDCP::Dictionary::MutableType(MDD_t type_id) +{ + assert(m_MDD_Table[0].name[0]); + std::map<ui32_t, ASDCP::UL>::iterator rii = m_md_rev_lookup.find(type_id); + + if ( rii == m_md_rev_lookup.end() ) + Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL type_id: %d\n", type_id); + + return m_MDD_Table[type_id]; +} + +// const ASDCP::MDDEntry* ASDCP::Dictionary::FindULAnyVersion(const byte_t* ul_buf) const { |
