title: ADTF recording file format
body: <p>I am coding an ADTF recording file reader in C++. I have already read the header using the structure specified here
  <a href="https://support.digitalwerk.net/adtf_libraries/adtf-streaming-library/v2/DATFileFormatSpecification.pdf" rel="nofollow noreferrer">https://support.digitalwerk.net/adtf_libraries/adtf-streaming-library/v2/DATFileFormatSpecification.pdf</a></p>
  
  <pre><code>typedef struct tagFileHeader { 
      int ui32FileId;
      int ui32VersionId;
      int ui32Flags;
      int ui32ExtensionCount;
      long long ui64ExtensionOffset;
      long long ui64DataOffset;
      long long ui64DataSize;
      long long ui64ChunkCount;
      long long ui64MaxChunkSize;
      long long ui64Duration;
      long long ui64FileTime;
      char ui8HeaderByteOrder;     
      long long ui64TimeOffset;
      char ui8PatchNumber;
      char _reserved[54];
      char strDescription[1912]; 
  } tFileHeader;   // size is 2048 Bytes
  </code></pre>
  
  <p>I read the heder</p>
  
  <pre><code>ifstream file("myfile.dat", std::ifstream::binary);
  char buffer[2048];
  file.read(buffer, 2048);
  const tagFileHeader* header = reinterpret_cast&lt;const tagFileHeader*&gt;(buffer);
  </code></pre>
  
  <p>And now I need to read the chunks. This is the chunks header, extracted from the same document</p>
  
  <pre><code>typedef struct tagChunkHeader { 
      long long ui64TimeStamp;
      int ui32RefMasterTableIndex;     
      int ui32OffsetToLast;     
      int ui32Size;     
      short ui16StreamId;     
      short ui16Flags;     
      long long ui64StreamIndex; 
  } tChunkHeader;  // size is 32 Bytes
  </code></pre>
  
  <p>Reading the chunks</p>
  
  <pre><code>for (int c = 0; c &lt; header-&gt;ui64ChunkCount; ++c)
  {
      char chunkHeaderBuffer[32];
      file.read(chunkHeaderBuffer, 32);
      const tChunkHeader* chunk = reinterpret_cast&lt;const tChunkHeader*&gt;(chunkHeaderBuffer);
      //Skeep chunk data
      file.seekg(chunk-&gt;ui32Size, ios_base::cur);
  }
  </code></pre>
  
  <p>I don't know how to interpret the chunk data. Is this specified in another document that I am missing?
  Thanks</p>