diff data/fileio/MP3FileReader.cpp @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 048173126e71
children a1cd5abcb38b
line wrap: on
line diff
--- a/data/fileio/MP3FileReader.cpp	Tue Mar 03 09:33:59 2015 +0000
+++ b/data/fileio/MP3FileReader.cpp	Tue Mar 03 15:18:24 2015 +0000
@@ -86,7 +86,7 @@
     }
     
     ssize_t sz = 0;
-    int offset = 0;
+    ssize_t offset = 0;
     while (offset < m_fileSize) {
         sz = ::read(fd, m_filebuffer + offset, m_fileSize - offset);
         if (sz < 0) {
@@ -291,7 +291,7 @@
 } 
 
 bool
-MP3FileReader::decode(void *mm, int sz)
+MP3FileReader::decode(void *mm, sv_frame_t sz)
 {
     DecoderData data;
     struct mad_decoder decoder;
@@ -320,7 +320,7 @@
 
 #ifdef HAVE_ID3TAG
     if (length > ID3_TAG_QUERYSIZE) {
-        int taglen = id3_tag_query(start, ID3_TAG_QUERYSIZE);
+        ssize_t taglen = id3_tag_query(start, ID3_TAG_QUERYSIZE);
         if (taglen > 0) {
 //            cerr << "ID3 tag length to skip: " << taglen << endl;
             start += taglen;
@@ -352,7 +352,7 @@
     int frames = pcm->length;
 
     if (header) {
-        m_bitrateNum += header->bitrate;
+        m_bitrateNum = m_bitrateNum + double(header->bitrate);
         m_bitrateDenom ++;
     }