From c25d86c7db9d6ea04cf95d56bff776b235c8c677 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 5 Nov 2016 07:11:08 +0100 Subject: [PATCH] sio_oss.c: if the requrested block size is a power of two make the oss block size calculation return the requested value. --- libsndio/sio_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsndio/sio_oss.c b/libsndio/sio_oss.c index d8959d2..22f4b47 100644 --- a/libsndio/sio_oss.c +++ b/libsndio/sio_oss.c @@ -460,7 +460,7 @@ sio_oss_setpar(struct sio_hdl *sh, struct sio_par *par) frag_max = round * hdl->chan * formats[i].bps; frag_shift = 0; - while (1 << (frag_shift + 1) < frag_max) + while (1 << (frag_shift + 1) <= frag_max) frag_shift++; frag_count = bufsz / round;