comparison data/fileio/CodedAudioFileReader.cpp @ 386:e6d11871e4c9

* Fix bug that was causing decoded audio files (mp3s, oggs) to come up some of the time with zero sample rate
author Chris Cannam
date Sat, 01 Mar 2008 16:17:44 +0000
parents f1ff248a793e
children be49bf95d4a5
comparison
equal deleted inserted replaced
385:9b35a1731c3d 386:e6d11871e4c9
96 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << std::endl; 96 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << std::endl;
97 m_fileRate = 48000; // got to have something 97 m_fileRate = 48000; // got to have something
98 } 98 }
99 if (m_sampleRate == 0) { 99 if (m_sampleRate == 0) {
100 m_sampleRate = m_fileRate; 100 m_sampleRate = m_fileRate;
101 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << std::endl;
101 } 102 }
102 if (m_fileRate != m_sampleRate) { 103 if (m_fileRate != m_sampleRate) {
103 std::cerr << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << std::endl; 104 std::cerr << "CodedAudioFileReader: resampling " << m_fileRate << " -> " << m_sampleRate << std::endl;
104 m_resampler = new Resampler(Resampler::FastestTolerable, 105 m_resampler = new Resampler(Resampler::FastestTolerable,
105 m_channelCount, 106 m_channelCount,