Mercurial > hg > svapp
diff audioio/AudioPulseAudioTarget.cpp @ 192:2b1869fccec1
* Avoid setting zero latency on source
author | Chris Cannam |
---|---|
date | Tue, 22 Jun 2010 09:45:19 +0000 |
parents | 3bd87e04f060 |
children | 0b3aa9b702bb |
line wrap: on
line diff
--- a/audioio/AudioPulseAudioTarget.cpp Tue Jun 15 11:36:02 2010 +0000 +++ b/audioio/AudioPulseAudioTarget.cpp Tue Jun 22 09:45:19 2010 +0000 @@ -163,12 +163,14 @@ pa_usec_t latency = 0; int negative = 0; if (pa_stream_get_latency(m_stream, &latency, &negative)) { - std::cerr << "AudioPulseAudioTarget::contextStateChanged: Failed to query latency" << std::endl; + std::cerr << "AudioPulseAudioTarget::streamWrite: Failed to query latency" << std::endl; } // std::cerr << "Latency = " << latency << " usec" << std::endl; int latframes = (latency / 1000000.f) * float(m_sampleRate); // std::cerr << "that's " << latframes << " frames" << std::endl; - m_source->setTargetPlayLatency(latframes); //!!! buh + if (latframes > 0) { + m_source->setTargetPlayLatency(latframes); //!!! buh + } } static float *output = 0;