diff options
-rw-r--r-- | Alc/alsa.c | 22 |
1 files changed, 4 insertions, 18 deletions
@@ -439,6 +439,10 @@ open_alsa: /* install and prepare hardware configuration */ if(err == NULL && (i=psnd_pcm_hw_params(data->pcmHandle, p)) < 0) err = "set params"; + if(err == NULL && (i=psnd_pcm_hw_params_get_access(p, &access)) < 0) + err = "get access"; + if(err == NULL && (i=psnd_pcm_hw_params_get_period_size(p, &bufferSizeInFrames, NULL)) < 0) + err = "get period size"; if(err != NULL) { AL_PRINT("%s failed: %s\n", err, psnd_strerror(i)); @@ -448,24 +452,6 @@ open_alsa: return ALC_FALSE; } - if((i=psnd_pcm_hw_params_get_access(p, &access)) < 0) - { - AL_PRINT("get_access failed: %s\n", psnd_strerror(i)); - psnd_pcm_hw_params_free(p); - psnd_pcm_close(data->pcmHandle); - free(data); - return ALC_FALSE; - } - - if((i=psnd_pcm_hw_params_get_period_size(p, &bufferSizeInFrames, NULL)) < 0) - { - AL_PRINT("get_period_size failed: %s\n", psnd_strerror(i)); - psnd_pcm_hw_params_free(p); - psnd_pcm_close(data->pcmHandle); - free(data); - return ALC_FALSE; - } - psnd_pcm_hw_params_free(p); err = NULL; |