summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 56e1cca..3b8d37d 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -609,13 +609,13 @@ snd_pcm_sframes_t
snd_pcm_avail_update(snd_pcm_t *pcm)
{
while (snd_pcm_wait(pcm, pcm->hw.period_time) && pcm->avail < pcm->sw.avail_min);
- return (pcm->avail > pcm->hw.par.appbufsz ? pcm->hw.par.appbufsz : pcm->avail);
+ return MIN(pcm->avail, pcm->hw.par.appbufsz);
}
snd_pcm_sframes_t
snd_pcm_avail(snd_pcm_t *pcm)
{
- return (pcm->avail > pcm->hw.par.appbufsz ? pcm->hw.par.appbufsz : pcm->avail);
+ return MIN(pcm->avail, pcm->hw.par.appbufsz);
}
int
@@ -1013,7 +1013,7 @@ snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
{
if (val) {
WARNX("%lu", *val);
- unsigned int newv = (*val < params->par.round * 2 ? params->par.round * 2 : *val);
+ unsigned int newv = MAX(*val, params->par.round * 2);
assert(sizeof(params->par.appbufsz) == sizeof(newv));
const int ret = update(pcm, &params->par, &params->par.appbufsz, &newv, sizeof(newv));
*val = newv;