summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 89ce9d0..284db19 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -307,7 +307,9 @@ snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
if (!(pcm->hdl = device_open(pcm, pcm->name, pcm->hw.stream, (nonblock ? SND_PCM_NONBLOCK : false))))
return -1;
- return snd_pcm_hw_params(pcm, &pcm->hw);
+ snd_pcm_hw_params_t params = pcm->hw;
+ pcm->hw = (snd_pcm_hw_params_t){0};
+ return snd_pcm_hw_params(pcm, &params);
}
int