X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2FDict.cpp;h=d50a836dc06e4743dc0d4a7054958722ec2424c2;hb=a5b15f66c30093efe376f0462e43ac4ac10e2e14;hp=3853e22f7b09840987ccb7444c8d0b732dd49d15;hpb=f7598051fa2ec0754bf7c5b2398dbaa54928f64b;p=asdcplib.git diff --git a/src/Dict.cpp b/src/Dict.cpp index 3853e22..d50a836 100755 --- a/src/Dict.cpp +++ b/src/Dict.cpp @@ -124,6 +124,19 @@ ASDCP::DefaultSMPTEDict() return s_SMPTEDict; } +// +const ASDCP::MDDEntry& +ASDCP::MXFInterop_OPAtom_Entry() { + return s_MDD_Table[MDD_MXFInterop_OPAtom]; +} + +// +const ASDCP::MDDEntry& +ASDCP::SMPTE_390_OPAtom_Entry() { + return s_MDD_Table[MDD_OPAtom]; +} + + //------------------------------------------------------------------------------------------ // @@ -164,6 +177,12 @@ ASDCP::Dictionary::Init() bool ASDCP::Dictionary::AddEntry(const MDDEntry& Entry, ui32_t index) { + if ( index >= (ui32_t)MDD_Max ) + { + Kumu::DefaultLogSink().Warn("UL Dictionary: index exceeds maximum: %d\n", index); + return false; + } + bool result = true; // is this index already there? std::map::iterator rii = m_md_rev_lookup.find(index); @@ -226,7 +245,7 @@ ASDCP::Dictionary::Type(MDD_t type_id) const std::map::const_iterator rii = m_md_rev_lookup.find(type_id); if ( rii == m_md_rev_lookup.end() ) - Kumu::DefaultLogSink().Warn("Unknown UL type_id: %d\n", type_id); + Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL type_id: %d\n", type_id); return m_MDD_Table[type_id]; } @@ -250,7 +269,7 @@ ASDCP::Dictionary::FindUL(const byte_t* ul_buf) const { char buf[64]; UL TmpUL(ul_buf); - Kumu::DefaultLogSink().Warn("Unknown UL: %s\n", TmpUL.EncodeString(buf, 64)); + Kumu::DefaultLogSink().Warn("UL Dictionary: unknown UL: %s\n", TmpUL.EncodeString(buf, 64)); return 0; } }