Fix comparisons between signed and unsigned values.
[asdcplib.git] / src / AS_02_PCM.cpp
index f62dcc369e20ebfe20b282a98107dbb713257eb3..de6412254b91a1c6e8647abcc29d837ba3c2e4a0 100644 (file)
@@ -25,6 +25,8 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
 /*! \file    AS_02_PCM.cpp
   \version $Id$       
   \brief   AS-02 library, PCM essence reader and writer implementation
@@ -104,7 +106,7 @@ AS_02::PCM::MXFReader::h__Reader::OpenRead(const std::string& filename, const AS
        {
          if ( ! UL(reader.Key()).MatchIgnoreStream(m_Dict->ul(MDD_WAVEssenceClip)) )
            {
-             const MDDEntry *entry = m_Dict->FindUL(reader.Key());
+             const MDDEntry *entry = m_Dict->FindULAnyVersion(reader.Key());
 
              if ( entry == 0 )
                {
@@ -149,7 +151,7 @@ AS_02::PCM::MXFReader::h__Reader::OpenRead(const std::string& filename, const AS
 //
 ASDCP::Result_t
 AS_02::PCM::MXFReader::h__Reader::ReadFrame(ui32_t FrameNum, ASDCP::PCM::FrameBuffer& FrameBuf,
-                                           ASDCP::AESDecContext* Ctx, ASDCP::HMACContext* HMAC)
+                                           ASDCP::AESDecContext*, ASDCP::HMACContext*)
 {
   if ( ! m_File.IsOpen() )
     {
@@ -166,7 +168,7 @@ AS_02::PCM::MXFReader::h__Reader::ReadFrame(ui32_t FrameNum, ASDCP::PCM::FrameBu
   ui64_t position = m_ClipEssenceBegin + offset;
   Result_t result = RESULT_OK;
 
-  if ( m_File.Tell() != position )
+  if ( m_File.Tell() != static_cast<Kumu::fpos_t>(position) )
     {
       result = m_File.Seek(position);
     }
@@ -253,7 +255,7 @@ AS_02::PCM::MXFReader::RIP()
 // Open the file for reading. The file must exist. Returns error if the
 // operation cannot be completed.
 ASDCP::Result_t
-AS_02::PCM::MXFReader::OpenRead(const std::string& filename, const ASDCP::Rational& edit_rate)
+AS_02::PCM::MXFReader::OpenRead(const std::string& filename, const ASDCP::Rational& edit_rate) const
 {
   return m_Reader->OpenRead(filename, edit_rate);
 }
@@ -305,16 +307,19 @@ void
 AS_02::PCM::MXFReader::DumpHeaderMetadata(FILE* stream) const
 {
   if ( m_Reader && m_Reader->m_File.IsOpen() )
-    m_Reader->m_HeaderPart.Dump(stream);
+    {
+      m_Reader->m_HeaderPart.Dump(stream);
+    }
 }
 
-
 //
 void
 AS_02::PCM::MXFReader::DumpIndex(FILE* stream) const
 {
-  if ( m_Reader->m_File.IsOpen() )
-    m_Reader->m_IndexAccess.Dump(stream);
+  if ( m_Reader && m_Reader->m_File.IsOpen() )
+    {
+      m_Reader->m_IndexAccess.Dump(stream);
+    }
 }