6832063: OpenJDK fails to open the default ALSA device when PulseAudio is enabled

Reviewed-by: amenkov
This commit is contained in:
Omair Majid 2009-11-27 17:54:45 +03:00 committed by Alex Menkov
parent a9413787d9
commit 609f2d2cef

View File

@ -143,8 +143,12 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre
ERROR1("snd_pcm_hw_params_malloc returned error %d\n", ret);
} else {
ret = snd_pcm_hw_params_any(handle, hwParams);
if (ret != 0) {
ERROR1("snd_pcm_hw_params_any returned error %d\n", ret);
/* snd_pcm_hw_params_any can return a positive value on success too */
if (ret < 0) {
ERROR1("snd_pcm_hw_params_any returned error %d\n", ret);
} else {
/* for the logic following this code, set ret to 0 to indicate success */
ret = 0;
}
}
snd_pcm_hw_params_get_format_mask(hwParams, formatMask);