X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fklvwalk.cpp;fp=src%2Fklvwalk.cpp;h=801389eaa5f731bb422a284ba84137186245cdc0;hb=2b101472bf1f76db63ae1c97cf5393fe7195bcb1;hp=779ee72bd2944f365b70c9dfaaac55a6c6c03dd4;hpb=cc05011a20424c6b855995b5965782582ca21c42;p=asdcplib.git diff --git a/src/klvwalk.cpp b/src/klvwalk.cpp index 779ee72..801389e 100755 --- a/src/klvwalk.cpp +++ b/src/klvwalk.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2005-2015, John Hurst +Copyright (c) 2005-2016, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -201,31 +201,33 @@ main(int argc, const char** argv) 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) )