diff data/fileio/MP3FileReader.cpp @ 1069:32ab6c48efaa

Merge from branch tonioni
author Chris Cannam
date Mon, 20 Apr 2015 09:11:34 +0100
parents a1cd5abcb38b
children 52d088c24c5c
line wrap: on
line diff
--- a/data/fileio/MP3FileReader.cpp	Mon Mar 02 17:21:34 2015 +0000
+++ b/data/fileio/MP3FileReader.cpp	Mon Apr 20 09:11:34 2015 +0100
@@ -37,7 +37,7 @@
 #include <QFileInfo>
 
 MP3FileReader::MP3FileReader(FileSource source, DecodeMode decodeMode, 
-                             CacheMode mode, int targetRate,
+                             CacheMode mode, sv_samplerate_t targetRate,
                              bool normalised,
                              ProgressReporter *reporter) :
     CodedAudioFileReader(mode, targetRate, normalised),
@@ -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 ++;
     }