Modified to enforce execution order of the predicates
[asdcplib.git] / src / asdcp-info.cpp
index 65edd097cc8ea17068c557933c0b298b0e6a4213..b8876fed903326fb417d3fb478a8f121eddd935b 100755 (executable)
@@ -35,6 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <KM_fileio.h>
 #include <AS_DCP.h>
+#include <AS_02.h>
 #include <MXF.h>
 #include <Metadata.h>
 
@@ -75,7 +76,7 @@ banner(FILE* stream = stdout)
 {
   fprintf(stream, "\n\
 %s (asdcplib %s)\n\n\
-Copyright (c) 2003-2014 John Hurst\n\n\
+Copyright (c) 2003-2015 John Hurst\n\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\
 Specify the -h (help) option for further information about %s\n\n",
@@ -163,7 +164,7 @@ public:
 
              case 't':
                TEST_EXTRA_ARG(i, 't');
-               max_bitrate = abs(atoi(argv[i]));
+               max_bitrate = Kumu::xabs(strtol(argv[i], 0, 10));
                max_bitrate_flag = true;
                break;
 
@@ -477,7 +478,7 @@ public:
          {
            if ( last_stream_offset != 0 )
              {
-               ui64_t this_frame_size = entry.StreamOffset - last_stream_offset;
+               ui64_t this_frame_size = entry.StreamOffset - last_stream_offset - 20; // do not count the bytes that represent the KLV wrapping 
                total_frame_bytes += this_frame_size;
 
                if ( this_frame_size > largest_frame )
@@ -630,6 +631,13 @@ show_file_info(CommandOptions& Options)
       FileInfoWrapper<ASDCP::ATMOS::MXFReader, MyAtmosDescriptor> wrapper;
       result = wrapper.file_info(Options, "Dolby ATMOS");
     }
+  else if ( EssenceType == ESS_AS02_PCM_24b_48k
+           || EssenceType == ESS_AS02_PCM_24b_96k
+           || EssenceType == ESS_AS02_JPEG_2000
+           || EssenceType == ESS_AS02_TIMED_TEXT )
+    {
+      fprintf(stderr, "File is AS-02. Inspection in not supported by this command.\n");
+    }
   else
     {
       fprintf(stderr, "File is not AS-DCP: %s\n", Options.filenames.front().c_str());