ReadFileIntoString() modified to return OK when the file is empty
[asdcplib.git] / src / h__Reader.cpp
index d0c5168929f0889aad076b5f66e36599cee11187..77f532e7fe20c1edd6d90a29d37b9ec9f1900c55 100755 (executable)
@@ -84,18 +84,18 @@ ASDCP::h__ASDCPReader::OpenMXFRead(const std::string& filename)
 
       m_Info.LabelSetType = LS_MXF_UNKNOWN;
 
-      if ( m_HeaderPart.OperationalPattern.ExactMatch(MXFInterop_OPAtom_Entry().ul) )
+      if ( m_HeaderPart.OperationalPattern.MatchExact(MXFInterop_OPAtom_Entry().ul) )
        {
          m_Info.LabelSetType = LS_MXF_INTEROP;
        }
-      else if ( m_HeaderPart.OperationalPattern.ExactMatch(SMPTE_390_OPAtom_Entry().ul) )
+      else if ( m_HeaderPart.OperationalPattern.MatchExact(SMPTE_390_OPAtom_Entry().ul) )
        {
          m_Info.LabelSetType = LS_MXF_SMPTE;
        }
       else
        {
          char strbuf[IdentBufferLen];
-         const MDDEntry* Entry = m_Dict->FindUL(m_HeaderPart.OperationalPattern.Value());
+         const MDDEntry* Entry = m_Dict->FindULExact(m_HeaderPart.OperationalPattern.Value());
 
          if ( Entry == 0 )
            {
@@ -108,7 +108,7 @@ ASDCP::h__ASDCPReader::OpenMXFRead(const std::string& filename)
            }
        }
 
-      if ( m_RIP.PairArray.front().ByteOffset != 0 )
+      if ( !m_RIP.PairArray.empty() && m_RIP.PairArray.front().ByteOffset != 0 )
        {
          DefaultLogSink().Error("First Partition in RIP is not at offset 0.\n");
          result = RESULT_FORMAT;
@@ -312,7 +312,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict,
       if ( ! UL(ess_p).MatchIgnoreStream(EssenceUL) ) // ignore the stream number
        {
          char strbuf[IntBufferLen];
-         const MDDEntry* Entry = Dict.FindUL(Key.Value());
+         const MDDEntry* Entry = Dict.FindULAnyVersion(Key.Value());
 
          if ( Entry == 0 )
            {
@@ -431,7 +431,7 @@ ASDCP::Read_EKLV_Packet(Kumu::FileReader& File, const ASDCP::Dictionary& Dict,
   else
     {
       char strbuf[IntBufferLen];
-      const MDDEntry* Entry = Dict.FindUL(Key.Value());
+      const MDDEntry* Entry = Dict.FindULAnyVersion(Key.Value());
 
       if ( Entry == 0 )
        {