comparison data/fileio/WavFileReader.cpp @ 936:0c1d6de8f44b

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:51:16 +0100
parents 59e7fe1b1003
children cc27f35aa75c
comparison
equal deleted inserted replaced
917:49618f39ff09 936:0c1d6de8f44b
87 void 87 void
88 WavFileReader::updateFrameCount() 88 WavFileReader::updateFrameCount()
89 { 89 {
90 QMutexLocker locker(&m_mutex); 90 QMutexLocker locker(&m_mutex);
91 91
92 size_t prevCount = m_fileInfo.frames; 92 int prevCount = m_fileInfo.frames;
93 93
94 if (m_file) { 94 if (m_file) {
95 sf_close(m_file); 95 sf_close(m_file);
96 m_file = sf_open(m_path.toLocal8Bit(), SFM_READ, &m_fileInfo); 96 m_file = sf_open(m_path.toLocal8Bit(), SFM_READ, &m_fileInfo);
97 if (!m_file || m_fileInfo.channels <= 0) { 97 if (!m_file || m_fileInfo.channels <= 0) {
121 updateFrameCount(); 121 updateFrameCount();
122 m_updating = false; 122 m_updating = false;
123 } 123 }
124 124
125 void 125 void
126 WavFileReader::getInterleavedFrames(size_t start, size_t count, 126 WavFileReader::getInterleavedFrames(int start, int count,
127 SampleBlock &results) const 127 SampleBlock &results) const
128 { 128 {
129 if (count == 0) return; 129 if (count == 0) return;
130 results.clear(); 130 results.clear();
131 results.reserve(count * m_fileInfo.channels); 131 results.reserve(count * m_fileInfo.channels);
171 171
172 m_lastStart = start; 172 m_lastStart = start;
173 m_lastCount = readCount; 173 m_lastCount = readCount;
174 } 174 }
175 175
176 for (size_t i = 0; i < count * m_fileInfo.channels; ++i) { 176 for (int i = 0; i < count * m_fileInfo.channels; ++i) {
177 if (i >= m_bufsiz) { 177 if (i >= m_bufsiz) {
178 cerr << "INTERNAL ERROR: WavFileReader::getInterleavedFrames: " << i << " >= " << m_bufsiz << endl; 178 cerr << "INTERNAL ERROR: WavFileReader::getInterleavedFrames: " << i << " >= " << m_bufsiz << endl;
179 } 179 }
180 results.push_back(m_buffer[i]); 180 results.push_back(m_buffer[i]);
181 } 181 }