summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 106cc28..4313f2b 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1154,7 +1154,9 @@ snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
WARNX("%u", *val);
unsigned int round = params->par.appbufsz / *val;
assert(sizeof(params->par.round) == sizeof(round));
- return update(pcm, &params->par, &params->par.round, &round, sizeof(*val));
+ const int ret = update(pcm, &params->par, &params->par.round, &round, sizeof(*val));
+ *val = params->par.appbufsz / params->par.round;
+ return ret;
}
return 0;
}