# HG changeset patch # User Chris Cannam # Date 1204388264 0 # Node ID 2485f822dc54add52f5170957dd059848b852eb7 # Parent 8591a0a3d57eafc4a9bf5057060b76a6e7940747 * Fix bug that was causing decoded audio files (mp3s, oggs) to come up some of the time with zero sample rate diff -r 8591a0a3d57e -r 2485f822dc54 audioio/AudioCallbackPlaySource.cpp --- a/audioio/AudioCallbackPlaySource.cpp Wed Feb 27 18:04:10 2008 +0000 +++ b/audioio/AudioCallbackPlaySource.cpp Sat Mar 01 16:17:44 2008 +0000 @@ -150,7 +150,7 @@ } #ifdef DEBUG_AUDIO_PLAY_SOURCE - std::cout << "Adding model with " << modelChannels << " channels " << std::endl; + std::cout << "Adding model with " << modelChannels << " channels at rate " << model->getSampleRate() << std::endl; #endif if (m_sourceSampleRate == 0) { @@ -1194,7 +1194,12 @@ } } - if (space == 0) return false; + if (space == 0) { +#ifdef DEBUG_AUDIO_PLAY_SOURCE + std::cout << "AudioCallbackPlaySourceFillThread: no space to fill" << std::endl; +#endif + return false; + } size_t f = m_writeBufferFill; @@ -1665,7 +1670,12 @@ work = false; - if (!s.getSourceSampleRate()) continue; + if (!s.getSourceSampleRate()) { +#ifdef DEBUG_AUDIO_PLAY_SOURCE + std::cout << "AudioCallbackPlaySourceFillThread: source sample rate is zero" << std::endl; +#endif + continue; + } bool playing = s.m_playing;