comparison audioio/AudioPortAudioTarget.cpp @ 95:dd6d0bc05030

* If the "default frame count" PA stream fails, try one with an explicit frame count
author Chris Cannam
date Tue, 12 Feb 2008 14:48:00 +0000
parents 9fc4b256c283
children e177e6ee7c12
comparison
equal deleted inserted replaced
94:9cc9862333bd 95:dd6d0bc05030
72 err = Pa_OpenStream(&m_stream, 0, &op, m_sampleRate, 72 err = Pa_OpenStream(&m_stream, 0, &op, m_sampleRate,
73 paFramesPerBufferUnspecified, 73 paFramesPerBufferUnspecified,
74 paNoFlag, processStatic, this); 74 paNoFlag, processStatic, this);
75 #endif 75 #endif
76 76
77 #ifndef HAVE_PORTAUDIO_V18
78 if (err != paNoError) {
79
80 std::cerr << "WARNING: AudioPortAudioTarget: Failed to open PortAudio stream with default frames per buffer, trying again with fixed frames per buffer..." << std::endl;
81
82 err = Pa_OpenStream(&m_stream, 0, &op, m_sampleRate,
83 1024,
84 paNoFlag, processStatic, this);
85 }
86 #endif
87
77 if (err != paNoError) { 88 if (err != paNoError) {
78 std::cerr << "ERROR: AudioPortAudioTarget: Failed to open PortAudio stream: " << Pa_GetErrorText(err) << std::endl; 89 std::cerr << "ERROR: AudioPortAudioTarget: Failed to open PortAudio stream: " << Pa_GetErrorText(err) << std::endl;
79 m_stream = 0; 90 m_stream = 0;
80 Pa_Terminate(); 91 Pa_Terminate();
81 return; 92 return;