Mercurial > hg > svcore
comparison data/fileio/CodedAudioFileReader.cpp @ 687:06f13a3b9e9e debug-output
Convert many cerrs to DEBUGs
author | Chris Cannam |
---|---|
date | Mon, 16 May 2011 17:19:09 +0100 |
parents | b4a8d8221eaf |
children | 1424aa29ae95 |
comparison
equal
deleted
inserted
replaced
686:b4a8d8221eaf | 687:06f13a3b9e9e |
---|---|
38 m_cacheWriteBufferIndex(0), | 38 m_cacheWriteBufferIndex(0), |
39 m_cacheWriteBufferSize(16384), | 39 m_cacheWriteBufferSize(16384), |
40 m_resampler(0), | 40 m_resampler(0), |
41 m_resampleBuffer(0) | 41 m_resampleBuffer(0) |
42 { | 42 { |
43 // std::cerr << "CodedAudioFileReader::CodedAudioFileReader: rate " << targetRate << std::endl; | 43 // DEBUG << "CodedAudioFileReader::CodedAudioFileReader: rate " << targetRate << endl; |
44 | 44 |
45 m_frameCount = 0; | 45 m_frameCount = 0; |
46 m_sampleRate = targetRate; | 46 m_sampleRate = targetRate; |
47 } | 47 } |
48 | 48 |
52 | 52 |
53 endSerialised(); | 53 endSerialised(); |
54 | 54 |
55 if (m_cacheFileWritePtr) sf_close(m_cacheFileWritePtr); | 55 if (m_cacheFileWritePtr) sf_close(m_cacheFileWritePtr); |
56 | 56 |
57 // std::cerr << "CodedAudioFileReader::~CodedAudioFileReader: deleting cache file reader" << std::endl; | 57 // DEBUG << "CodedAudioFileReader::~CodedAudioFileReader: deleting cache file reader" << endl; |
58 | 58 |
59 delete m_cacheFileReader; | 59 delete m_cacheFileReader; |
60 delete[] m_cacheWriteBuffer; | 60 delete[] m_cacheWriteBuffer; |
61 | 61 |
62 if (m_cacheFileName != "") { | 62 if (m_cacheFileName != "") { |
70 } | 70 } |
71 | 71 |
72 void | 72 void |
73 CodedAudioFileReader::startSerialised(QString id) | 73 CodedAudioFileReader::startSerialised(QString id) |
74 { | 74 { |
75 // std::cerr << "CodedAudioFileReader::startSerialised(" << id << ")" << std::endl; | 75 // DEBUG << "CodedAudioFileReader::startSerialised(" << id << ")" << endl; |
76 | 76 |
77 delete m_serialiser; | 77 delete m_serialiser; |
78 m_serialiser = new Serialiser(id); | 78 m_serialiser = new Serialiser(id); |
79 } | 79 } |
80 | 80 |
90 void | 90 void |
91 CodedAudioFileReader::initialiseDecodeCache() | 91 CodedAudioFileReader::initialiseDecodeCache() |
92 { | 92 { |
93 QMutexLocker locker(&m_cacheMutex); | 93 QMutexLocker locker(&m_cacheMutex); |
94 | 94 |
95 // std::cerr << "CodedAudioFileReader::initialiseDecodeCache: file rate = " << m_fileRate << std::endl; | 95 // DEBUG << "CodedAudioFileReader::initialiseDecodeCache: file rate = " << m_fileRate << endl; |
96 | 96 |
97 if (m_fileRate == 0) { | 97 if (m_fileRate == 0) { |
98 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << std::endl; | 98 DEBUG << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << endl; |
99 m_fileRate = 48000; // got to have something | 99 m_fileRate = 48000; // got to have something |
100 } | 100 } |
101 if (m_sampleRate == 0) { | 101 if (m_sampleRate == 0) { |
102 m_sampleRate = m_fileRate; | 102 m_sampleRate = m_fileRate; |
103 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << std::endl; | 103 DEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; |
104 } | 104 } |
105 if (m_fileRate != m_sampleRate) { | 105 if (m_fileRate != m_sampleRate) { |
106 std::cerr << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << std::endl; | 106 std::cerr << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << std::endl; |
107 m_resampler = new Resampler(Resampler::FastestTolerable, | 107 m_resampler = new Resampler(Resampler::FastestTolerable, |
108 m_channelCount, | 108 m_channelCount, |
352 // Lock is only required in CacheInMemory mode (the cache file | 352 // Lock is only required in CacheInMemory mode (the cache file |
353 // reader is expected to be thread safe and manage its own | 353 // reader is expected to be thread safe and manage its own |
354 // locking) | 354 // locking) |
355 | 355 |
356 if (!m_initialised) { | 356 if (!m_initialised) { |
357 std::cerr << "CodedAudioFileReader::getInterleavedFrames: not initialised" << std::endl; | 357 DEBUG << "CodedAudioFileReader::getInterleavedFrames: not initialised" << endl; |
358 return; | 358 return; |
359 } | 359 } |
360 | 360 |
361 switch (m_cacheMode) { | 361 switch (m_cacheMode) { |
362 | 362 |