comparison audioio/AudioCallbackPlaySource.cpp @ 131:883f7fc7fd34

* fix thtoopid mithtake
author Chris Cannam
date Mon, 07 Jul 2008 17:16:18 +0000
parents 4c9c04645685
children 3b61a975b47e
comparison
equal deleted inserted replaced
130:4c9c04645685 131:883f7fc7fd34
1123 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING 1123 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
1124 std::cerr << "reqd = " <<reqd << ", channels = " << channels << ", ic = " << m_stretcherInputCount << std::endl; 1124 std::cerr << "reqd = " <<reqd << ", channels = " << channels << ", ic = " << m_stretcherInputCount << std::endl;
1125 #endif 1125 #endif
1126 1126
1127 for (size_t c = 0; c < channels; ++c) { 1127 for (size_t c = 0; c < channels; ++c) {
1128 if (c >= m_stretcherInputSizes) continue; 1128 if (c >= m_stretcherInputCount) continue;
1129 if (reqd > m_stretcherInputSizes[c]) { 1129 if (reqd > m_stretcherInputSizes[c]) {
1130 if (c == 0) { 1130 if (c == 0) {
1131 std::cerr << "WARNING: resizing stretcher input buffer from " << m_stretcherInputSizes[c] << " to " << (reqd * 2) << std::endl; 1131 std::cerr << "WARNING: resizing stretcher input buffer from " << m_stretcherInputSizes[c] << " to " << (reqd * 2) << std::endl;
1132 } 1132 }
1133 delete[] m_stretcherInputs[c]; 1133 delete[] m_stretcherInputs[c];
1135 m_stretcherInputs[c] = new float[m_stretcherInputSizes[c]]; 1135 m_stretcherInputs[c] = new float[m_stretcherInputSizes[c]];
1136 } 1136 }
1137 } 1137 }
1138 1138
1139 for (size_t c = 0; c < channels; ++c) { 1139 for (size_t c = 0; c < channels; ++c) {
1140 if (c >= m_stretcherInputSizes) continue; 1140 if (c >= m_stretcherInputCount) continue;
1141 RingBuffer<float> *rb = getReadRingBuffer(c); 1141 RingBuffer<float> *rb = getReadRingBuffer(c);
1142 if (rb) { 1142 if (rb) {
1143 size_t gotHere; 1143 size_t gotHere;
1144 if (stretchChannels == 1 && c > 0) { 1144 if (stretchChannels == 1 && c > 0) {
1145 gotHere = rb->readAdding(m_stretcherInputs[0], got); 1145 gotHere = rb->readAdding(m_stretcherInputs[0], got);