added dist hook for new napali source.
[asdcplib.git] / src / PCM_Parser.cpp
index 331bebfc86b25bdf539811fce4f5eb1e68302465..2f96d2359047b6a6a9bd6173f47d85f1946b3aae 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2004, John Hurst
+Copyright (c) 2004-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -31,6 +31,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <Wav.h>
 #include <assert.h>
+#include <KM_log.h>
+using Kumu::DefaultLogSink;
 
 using namespace ASDCP;
 using namespace ASDCP::PCM;
@@ -42,7 +44,7 @@ using namespace ASDCP::Wav;
 //
 class ASDCP::PCM::WAVParser::h__WAVParser
 {
-  FileReader       m_FileReader;
+  Kumu::FileReader m_FileReader;
   bool             m_EOF;
   ui32_t           m_DataStart;
   ui32_t           m_DataLength;
@@ -108,6 +110,7 @@ ASDCP::PCM::WAVParser::h__WAVParser::OpenRead(const char* filename, const Ration
          m_FrameBufferSize = ASDCP::PCM::CalcFrameBufferSize(m_ADesc);
          m_DataLength = WavHeader.data_len;
          m_ADesc.ContainerDuration = m_DataLength / m_FrameBufferSize;
+         m_ADesc.ChannelFormat = PCM::CF_NONE;
          Reset();
        }
       else
@@ -123,6 +126,7 @@ ASDCP::PCM::WAVParser::h__WAVParser::OpenRead(const char* filename, const Ration
              m_FrameBufferSize = ASDCP::PCM::CalcFrameBufferSize(m_ADesc);
              m_DataLength = AIFFHeader.data_len;
              m_ADesc.ContainerDuration = m_DataLength / m_FrameBufferSize;
+             m_ADesc.ChannelFormat = PCM::CF_NONE;
              Reset();
            }
        }
@@ -142,7 +146,7 @@ ASDCP::PCM::WAVParser::h__WAVParser::ReadFrame(FrameBuffer& FB)
 
   if ( FB.Capacity() < m_FrameBufferSize )
     {
-      DefaultLogSink().Error("FrameBuf.Capacity: %lu FrameLength: %lu\n",
+      DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %u\n",
                             FB.Capacity(), m_FrameBufferSize);
       return RESULT_SMALLBUF;
     }