diff options
author | eb | 2006-09-10 18:14:55 +0000 |
---|---|---|
committer | eb | 2006-09-10 18:14:55 +0000 |
commit | d663513cd3fd9012b1bb6e6240691d6ddcc31f74 (patch) | |
tree | 46571d2e35d4a3b3b334e59d5ede8db95921fcfa | |
parent | c320874dd0444cff1f1d9669e3f3efa9dd2a74c7 (diff) | |
download | gnuradio-d663513cd3fd9012b1bb6e6240691d6ddcc31f74.tar.gz gnuradio-d663513cd3fd9012b1bb6e6240691d6ddcc31f74.tar.bz2 gnuradio-d663513cd3fd9012b1bb6e6240691d6ddcc31f74.zip |
fixed ticket:46 by applying Don's patch
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3511 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r-- | gr-audio-portaudio/src/audio_portaudio_sink.cc | 9 | ||||
-rw-r--r-- | gr-audio-portaudio/src/audio_portaudio_source.cc | 11 |
2 files changed, 15 insertions, 5 deletions
diff --git a/gr-audio-portaudio/src/audio_portaudio_sink.cc b/gr-audio-portaudio/src/audio_portaudio_sink.cc index 06bcc957a..602f11835 100644 --- a/gr-audio-portaudio/src/audio_portaudio_sink.cc +++ b/gr-audio-portaudio/src/audio_portaudio_sink.cc @@ -176,16 +176,21 @@ audio_portaudio_sink::audio_portaudio_sink(int sampling_rate, for (i=0;i<numDevices;i++) { deviceInfo = Pa_GetDeviceInfo( i ); fprintf(stderr,"Testing device name: %s",deviceInfo->name); + if (deviceInfo->maxOutputChannels <= 0) { + fprintf(stderr,"\n"); + continue; + } if (strstr(deviceInfo->name, d_device_name.c_str())){ fprintf(stderr," Chosen!\n"); - device = gri_pa_find_device_by_name(deviceInfo->name); + device = i; fprintf(stderr,"%s using %s as the host\n",d_device_name.c_str(), Pa_GetHostApiInfo(deviceInfo->hostApi)->name), fflush(stderr); found = true; deviceInfo = Pa_GetDeviceInfo(device); i = numDevices; // force loop exit } - fprintf(stderr,"\n"),fflush(stderr); + else + fprintf(stderr,"\n"),fflush(stderr); } if (!found){ diff --git a/gr-audio-portaudio/src/audio_portaudio_source.cc b/gr-audio-portaudio/src/audio_portaudio_source.cc index 3741e826c..8638d4369 100644 --- a/gr-audio-portaudio/src/audio_portaudio_source.cc +++ b/gr-audio-portaudio/src/audio_portaudio_source.cc @@ -102,7 +102,7 @@ portaudio_source_callback (const void *inputBuffer, self->d_log->printf("PAsrc cb: f/b = %4ld OVERRUN\n", framesPerBuffer); self->d_noverruns++; - ::write(2, "aU", 2); // FIXME change to non-blocking call + ::write(2, "aO", 2); // FIXME change to non-blocking call #if 0 // copy any frames that will fit @@ -181,16 +181,21 @@ audio_portaudio_source::audio_portaudio_source(int sampling_rate, for (i=0;i<numDevices;i++) { deviceInfo = Pa_GetDeviceInfo( i ); fprintf(stderr,"Testing device name: %s",deviceInfo->name); + if (deviceInfo->maxInputChannels <= 0) { + fprintf(stderr,"\n"); + continue; + } if (strstr(deviceInfo->name, d_device_name.c_str())){ fprintf(stderr," Chosen!\n"); - device = gri_pa_find_device_by_name(deviceInfo->name); + device = i; fprintf(stderr,"%s using %s as the host\n",d_device_name.c_str(), Pa_GetHostApiInfo(deviceInfo->hostApi)->name), fflush(stderr); found = true; deviceInfo = Pa_GetDeviceInfo(device); i = numDevices; // force loop exit } - fprintf(stderr,"\n"),fflush(stderr); + else + fprintf(stderr,"\n"),fflush(stderr); } if (!found){ |