goto finish;
if (_use_mmap) {
- if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
+
+ if (snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED) < 0) {
/* mmap() didn't work, fall back to interleaved */
SND_PCM_NO_AUTO_CHANNELS|
(reformat ? 0 : SND_PCM_NO_AUTO_FORMAT))) < 0) {
pa_log_info("Error opening PCM device %s: %s", d, snd_strerror(err));
- pa_xfree(d);
- return NULL;
+ goto fail;
}
if ((err = pa_alsa_set_hw_params(pcm_handle, ss, nfrags, period_size, tsched_size, use_mmap, use_tsched, require_exact_channel_number)) < 0) {
}
pa_log_info("Failed to set hardware parameters on %s: %s", d, snd_strerror(err));
- pa_xfree(d);
snd_pcm_close(pcm_handle);
- return NULL;
+
+ goto fail;
}
if (dev)
return pcm_handle;
}
+
+fail:
+ pa_xfree(d);
+
+ return NULL;
}
int pa_alsa_probe_profiles(