-// AS-DCP method of populating the in-memory index
-Result_t
-ASDCP::h__ASDCPReader::InitMXFIndex()
-{
- if ( ! m_File.IsOpen() )
- return RESULT_INIT;
+ if ( m_RIP.PairArray.front().ByteOffset != 0 )
+ {
+ DefaultLogSink().Error("First Partition in RIP is not at offset 0.\n");
+ result = RESULT_FORMAT;
+ }
+
+ //
+ if ( m_RIP.PairArray.size() < 2 )
+ {
+ // OP-Atom states that there will be either two or three partitions:
+ // one closed header and one closed footer with an optional body
+ // SMPTE 429-5 files may have many partitions, see SMPTE ST 410.
+ DefaultLogSink().Warn("RIP entry count is less than 2: %u\n", m_RIP.PairArray.size());
+ }
+ else if ( m_RIP.PairArray.size() > 2 )
+ {
+ // if this is a three partition file, go to the body
+ // partition and read the partition pack
+ RIP::const_pair_iterator r_i = m_RIP.PairArray.begin();
+ r_i++;
+ m_File.Seek((*r_i).ByteOffset);
+ result = m_BodyPart.InitFromFile(m_File);