comparison data/fileio/CoreAudioFileReader.cpp @ 1160:ea636412f9fe 3.0-integration

Merge from the default branch
author Chris Cannam
date Thu, 04 Feb 2016 11:16:05 +0000
parents 9c7633904ec2
children 0a9193dc136b
comparison
equal deleted inserted replaced
1159:444d133b5ab7 1160:ea636412f9fe
55 text[4] = '\0'; 55 text[4] = '\0';
56 return QString("%1 (%2)").arg(err).arg(QString::fromLocal8Bit(text)); 56 return QString("%1 (%2)").arg(err).arg(QString::fromLocal8Bit(text));
57 } 57 }
58 58
59 CoreAudioFileReader::CoreAudioFileReader(FileSource source, 59 CoreAudioFileReader::CoreAudioFileReader(FileSource source,
60 DecodeMode decodeMode, 60 DecodeMode /* decodeMode */,
61 CacheMode mode, 61 CacheMode mode,
62 sv_samplerate_t targetRate, 62 sv_samplerate_t targetRate,
63 bool normalised, 63 bool normalised,
64 ProgressReporter *reporter) : 64 ProgressReporter *reporter) :
65 CodedAudioFileReader(mode, targetRate, normalised), 65 CodedAudioFileReader(mode, targetRate, normalised),
178 // cerr << "Read " << framesRead << " frames (block size " << m_d->blockSize << ")" << endl; 178 // cerr << "Read " << framesRead << " frames (block size " << m_d->blockSize << ")" << endl;
179 179
180 // buffers are interleaved unless specified otherwise 180 // buffers are interleaved unless specified otherwise
181 addSamplesToDecodeCache((float *)m_d->buffer.mBuffers[0].mData, framesRead); 181 addSamplesToDecodeCache((float *)m_d->buffer.mBuffers[0].mData, framesRead);
182 182
183 if (framesRead < m_d->blockSize) break; 183 if ((int)framesRead < m_d->blockSize) break;
184 } 184 }
185 185
186 finishDecodeCache(); 186 finishDecodeCache();
187 endSerialised(); 187 endSerialised();
188 188
194 { 194 {
195 cerr << "CoreAudioFileReader::~CoreAudioFileReader" << endl; 195 cerr << "CoreAudioFileReader::~CoreAudioFileReader" << endl;
196 196
197 if (m_d->valid) { 197 if (m_d->valid) {
198 ExtAudioFileDispose(m_d->file); 198 ExtAudioFileDispose(m_d->file);
199 delete[] m_d->buffer.mBuffers[0].mData; 199 delete[] (float *)(m_d->buffer.mBuffers[0].mData);
200 } 200 }
201 201
202 delete m_d; 202 delete m_d;
203 } 203 }
204 204