Default value of Flags in Index Entry Array fixed
[asdcplib.git] / src / MXF.h
index b90ebb7cc4ac3e9ca30548e1e5bfe6c85088df1c..d6e201a420a76f4bd52e300022747bd0ded226be 100755 (executable)
--- a/src/MXF.h
+++ b/src/MXF.h
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005-2015, John Hurst
+Copyright (c) 2005-2018, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -185,12 +185,22 @@ namespace ASDCP
            LocalTagEntry(const TagValue& tag, ASDCP::UL& ul) : Tag(tag), UL(ul) {}
 
              bool operator<(const LocalTagEntry& rhs) const {
-               return ( ( Tag.a < rhs.Tag.a ) || ( Tag.b < rhs.Tag.b ) );
+               if ( Tag.a < rhs.Tag.a )
+                 {
+                   return true;
+                 }
+               
+               if ( Tag.a == rhs.Tag.a && Tag.b < rhs.Tag.b )
+                 {
+                   return true;
+                 }
+
+               return false;
              }
 
              inline const char* EncodeString(char* str_buf, ui32_t buf_len) const {
                snprintf(str_buf, buf_len, "%02x %02x: ", Tag.a, Tag.b);
-               UL.EncodeString(str_buf + strlen(str_buf), buf_len - strlen(str_buf));
+               UL.EncodeString(str_buf + strlen(str_buf), buf_len - (ui32_t)strlen(str_buf));
                return str_buf;
              }
 
@@ -322,6 +332,7 @@ namespace ASDCP
          Batch<UL>    EssenceContainers;
          Batch<UL>    DMSchemes;
          optional_property<Batch<UL> > ApplicationSchemes;
+         optional_property<Batch<UL> > ConformsToSpecifications;
 
          Preface(const Dictionary*& d);
          virtual ~Preface() {}
@@ -374,7 +385,7 @@ namespace ASDCP
              //              std::list<ui32_t>  SliceOffset;
              //              Array<Rational>    PosTable;
 
-             IndexEntry() : TemporalOffset(0), KeyFrameOffset(0), Flags(0), StreamOffset(0) {}
+             IndexEntry() : TemporalOffset(0), KeyFrameOffset(0), Flags(0x80), StreamOffset(0) {}
              IndexEntry(i8_t t_ofst, i8_t k_ofst, ui8_t flags, ui64_t s_ofst) :
                    TemporalOffset(t_ofst), KeyFrameOffset(k_ofst), Flags(flags), StreamOffset(s_ofst) {}
              inline bool HasValue() const { return true; }