comparison data/fileio/CodedAudioFileReader.cpp @ 398:be49bf95d4a5

* Fix hang when using more than one consecutive coded audio file reader in decode-at-once mode
author Chris Cannam
date Wed, 26 Mar 2008 14:35:03 +0000
parents e6d11871e4c9
children 3012af787e4a
comparison
equal deleted inserted replaced
397:78491f21061d 398:be49bf95d4a5
77 } 77 }
78 78
79 void 79 void
80 CodedAudioFileReader::endSerialised() 80 CodedAudioFileReader::endSerialised()
81 { 81 {
82 // std::cerr << "CodedAudioFileReader::endSerialised" << std::endl; 82 std::cerr << "CodedAudioFileReader::endSerialised" << std::endl;
83 83
84 delete m_serialiser; 84 delete m_serialiser;
85 m_serialiser = 0; 85 m_serialiser = 0;
86 } 86 }
87 87
105 m_resampler = new Resampler(Resampler::FastestTolerable, 105 m_resampler = new Resampler(Resampler::FastestTolerable,
106 m_channelCount, 106 m_channelCount,
107 m_cacheWriteBufferSize); 107 m_cacheWriteBufferSize);
108 float ratio = float(m_sampleRate) / float(m_fileRate); 108 float ratio = float(m_sampleRate) / float(m_fileRate);
109 m_resampleBuffer = new float 109 m_resampleBuffer = new float
110 [lrintf(ceilf(m_cacheWriteBufferSize * m_channelCount * ratio))]; 110 [lrintf(ceilf(m_cacheWriteBufferSize * m_channelCount * ratio + 1))];
111 } 111 }
112 112
113 m_cacheWriteBuffer = new float[m_cacheWriteBufferSize * m_channelCount]; 113 m_cacheWriteBuffer = new float[m_cacheWriteBufferSize * m_channelCount];
114 m_cacheWriteBufferIndex = 0; 114 m_cacheWriteBufferIndex = 0;
115 115