summaryrefslogtreecommitdiff
path: root/src/MXF.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2007-03-26 23:08:16 +0000
committerjhurst <>2007-03-26 23:08:16 +0000
commit253b0b7af5aacd4e112190689fbdeb10968ca074 (patch)
treeeb099ebc6e627ea3f7329af92641e756e3e3cae3 /src/MXF.cpp
parent3a4cfef4ecefd74ff3684d06e931414f8baf3580 (diff)
added identifier list type
Diffstat (limited to 'src/MXF.cpp')
-rwxr-xr-xsrc/MXF.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp
index 8bc2d0e..168ee52 100755
--- a/src/MXF.cpp
+++ b/src/MXF.cpp
@@ -629,17 +629,12 @@ ASDCP::MXF::OPAtomHeader::InitFromFile(const Kumu::FileReader& Reader)
else
{
m_HasRIP = true;
- }
- }
-
- if ( ASDCP_SUCCESS(result) )
- {
- Array<RIP::Pair>::iterator r_i = m_RIP.PairArray.begin();
- if ( (*r_i).ByteOffset != 0 )
- {
- DefaultLogSink().Error("First Partition in RIP is not at offset 0.\n");
- result = RESULT_FORMAT;
+ if ( m_RIP.PairArray.front().ByteOffset != 0 )
+ {
+ DefaultLogSink().Error("First Partition in RIP is not at offset 0.\n");
+ result = RESULT_FORMAT;
+ }
}
}
@@ -649,6 +644,9 @@ ASDCP::MXF::OPAtomHeader::InitFromFile(const Kumu::FileReader& Reader)
if ( ASDCP_SUCCESS(result) )
result = Partition::InitFromFile(Reader); // test UL and OP
+ if ( ASDCP_FAILURE(result) )
+ return result;
+
// is it really OP-Atom?
UL OPAtomUL(Dict::ul(MDD_OPAtom));
UL InteropOPAtomUL(Dict::ul(MDD_MXFInterop_OPAtom));
@@ -664,24 +662,24 @@ ASDCP::MXF::OPAtomHeader::InitFromFile(const Kumu::FileReader& Reader)
}
// slurp up the remainder of the header
- if ( ASDCP_SUCCESS(result) )
- {
- if ( HeaderByteCount < 1024 )
- DefaultLogSink().Warn("Improbably small HeaderByteCount value: %u\n", HeaderByteCount);
+ if ( HeaderByteCount < 1024 )
+ DefaultLogSink().Warn("Improbably small HeaderByteCount value: %u\n", HeaderByteCount);
- result = m_Buffer.Capacity(HeaderByteCount);
- }
+ result = m_Buffer.Capacity(HeaderByteCount);
if ( ASDCP_SUCCESS(result) )
{
ui32_t read_count;
result = Reader.Read(m_Buffer.Data(), m_Buffer.Capacity(), &read_count);
- if ( ASDCP_SUCCESS(result) && read_count != m_Buffer.Capacity() )
+ if ( ASDCP_FAILURE(result) )
+ return result;
+
+ if ( read_count != m_Buffer.Capacity() )
{
DefaultLogSink().Error("Short read of OP-Atom header metadata; wanted %u, got %u\n",
m_Buffer.Capacity(), read_count);
- return RESULT_FAIL;
+ return RESULT_KLV_CODING;
}
}