Reverting const accessor for class optional_property
[asdcplib.git] / src / Wav.cpp
index 20776d56190446e5d3004f3d14f863ede950df41..2ffadd404cecc360a8f5827db0e73d87b46ada14 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005-2015, John Hurst
+Copyright (c) 2005-2018, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -175,7 +175,7 @@ ASDCP::Wav::SimpleWaveHeader::ReadFromBuffer(const byte_t* buf, ui32_t buf_len,
        {
          ui16_t format = KM_i16_LE(*(ui16_t*)p); p += 2;
 
-         if ( format != WAVE_FORMAT_PCM && format != WAVE_FORMAT_EXTENSIBLE )
+         if ( format != ASDCP_WAVE_FORMAT_PCM && format != ASDCP_WAVE_FORMAT_EXTENSIBLE )
            {
              DefaultLogSink().Error("Expecting uncompressed PCM data, got format type %hd\n", format);
              return RESULT_RAW_FORMAT;
@@ -548,14 +548,17 @@ ASDCP::RF64::SimpleRF64Header::ReadFromBuffer(const byte_t* buf, ui32_t buf_len,
 
         if ( test_fcc == Wav::FCC_data )
         {
-            if ( chunk_size > RIFF_len )
-            {
-                DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
-                return RESULT_RAW_FORMAT;
-            }
+            if ( chunk_size != MAX_RIFF_LEN )
+             {
+               if ( chunk_size > RIFF_len )
+                 {
+                   DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
+                   return RESULT_RAW_FORMAT;
+                 }
 
-            if (chunk_size != MAX_RIFF_LEN)
                 data_len = chunk_size;
+             }
             *data_start = p - buf;
             break;
         }
@@ -564,7 +567,7 @@ ASDCP::RF64::SimpleRF64Header::ReadFromBuffer(const byte_t* buf, ui32_t buf_len,
         {
             ui16_t format = KM_i16_LE(*(ui16_t*)p); p += 2;
 
-            if ( format != Wav::WAVE_FORMAT_PCM && format != Wav::WAVE_FORMAT_EXTENSIBLE )
+            if ( format != Wav::ASDCP_WAVE_FORMAT_PCM && format != Wav::ASDCP_WAVE_FORMAT_EXTENSIBLE )
             {
                 DefaultLogSink().Error("Expecting uncompressed PCM data, got format type %hd\n", format);
                 return RESULT_RAW_FORMAT;