/*
-Copyright (c) 2005-2009, John Hurst
+Copyright (c) 2005-2018, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
{
fprintf(stream, "\n\
%s (asdcplib %s)\n\n\
-Copyright (c) 2005-2009 John Hurst\n\
+Copyright (c) 2005-2013 John Hurst\n\
%s is part of the asdcplib DCP tools package.\n\
asdcplib may be copied only under the terms of the license found at\n\
the top of every file in the asdcplib distribution kit.\n\n\
ASDCP::MXF::OP1aHeader Header(Dict);
ASDCP::MXF::RIP RIP(Dict);
- result = Reader.OpenRead((*fi).c_str());
+ result = Reader.OpenRead(*fi);
- if ( ASDCP_SUCCESS(result) )
- result = MXF::SeekToRIP(Reader);
-
if ( ASDCP_SUCCESS(result) )
{
- result = RIP.InitFromFile(Reader);
- ui32_t test_s = RIP.PairArray.size();
-
- if ( ASDCP_FAILURE(result) )
+ result = MXF::SeekToRIP(Reader);
+
+ if ( ASDCP_SUCCESS(result) )
{
- DefaultLogSink().Error("File contains no RIP\n");
- result = RESULT_OK;
+ result = RIP.InitFromFile(Reader);
+ ui32_t test_s = RIP.PairArray.size();
+
+ if ( ASDCP_FAILURE(result) )
+ {
+ DefaultLogSink().Error("File contains no RIP\n");
+ result = RESULT_OK;
+ }
+ else if ( RIP.PairArray.empty() )
+ {
+ DefaultLogSink().Error("RIP contains no Pairs.\n");
+ }
+
+ Reader.Seek(0);
}
- else if ( RIP.PairArray.empty() )
+ else
{
- DefaultLogSink().Error("RIP contains no Pairs.\n");
+ DefaultLogSink().Error("read_mxf SeekToRIP failed: %s\n", result.Label());
}
-
- Reader.Seek(0);
- }
- else
- {
- DefaultLogSink().Error("read_mxf SeekToRIP failed: %s\n", result.Label());
}
if ( ASDCP_SUCCESS(result) )
if ( ASDCP_SUCCESS(result) && RIP.PairArray.size() > 2 )
{
- MXF::Array<MXF::RIP::Pair>::const_iterator pi = RIP.PairArray.begin();
+ MXF::RIP::const_pair_iterator pi = RIP.PairArray.begin();
for ( pi++; pi != RIP.PairArray.end() && ASDCP_SUCCESS(result); pi++ )
{
{
RIP.Dump();
- MXF::Array<MXF::RIP::Pair>::const_iterator i;
+ MXF::RIP::const_pair_iterator i;
for ( i = RIP.PairArray.begin(); i != RIP.PairArray.end(); ++i )
{
Reader.Seek(i->ByteOffset);
while ( ASDCP_SUCCESS(result) )
{
- fprintf(stdout, "@0x%08qx: ", pos);
+ fprintf(stdout, "@0x%08llx: ", pos);
KP.Dump(stdout, DefaultCompositeDict(), true);
pos = Reader.Tell();
result = KP.InitFromFile(Reader);