diff --git a/ChangeLog b/ChangeLog index aa1d51a6..07ef2e3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ --------------------------- Jackdmp changes log --------------------------- + +2007-02-14 Stephane Letz + + * Better error checking in PortAudio driver. 2007-02-07 Stephane Letz diff --git a/windows/JackPortAudioDriver.cpp b/windows/JackPortAudioDriver.cpp index cefdb4e7..ec44bde7 100644 --- a/windows/JackPortAudioDriver.cpp +++ b/windows/JackPortAudioDriver.cpp @@ -284,7 +284,9 @@ int JackPortAudioDriver::Open(jack_nframes_t nframes, if (capturing) { if (!GetInputDeviceFromName(capture_driver_uid, &fInputDevice, &in_max)) { JackLog("JackPortAudioDriver::GetInputDeviceFromName cannot open %s\n", capture_driver_uid); - fInputDevice = Pa_GetDefaultInputDevice(); + fInputDevice = Pa_GetDefaultInputDevice(); + if (fInputDevice == paNoDevice) + goto error; deviceInfo = Pa_GetDeviceInfo(fInputDevice); in_max = deviceInfo->maxInputChannels; capture_driver_uid = strdup(deviceInfo->name); @@ -299,7 +301,9 @@ int JackPortAudioDriver::Open(jack_nframes_t nframes, if (playing) { if (!GetOutputDeviceFromName(playback_driver_uid, &fOutputDevice, &out_max)) { JackLog("JackPortAudioDriver::GetOutputDeviceFromName cannot open %s\n", playback_driver_uid); - fOutputDevice = Pa_GetDefaultOutputDevice(); + fOutputDevice = Pa_GetDefaultOutputDevice(); + if (fOutputDevice == paNoDevice) + goto error; deviceInfo = Pa_GetDeviceInfo(fOutputDevice); out_max = deviceInfo->maxOutputChannels; playback_driver_uid = strdup(deviceInfo->name);