From 9cb5193ca7e47484e3c02f6e6ed6294f0e309dbe Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 5 Nov 2016 07:21:28 +0100 Subject: [PATCH] sio_oss.c: In full duplex-mode, don't require play and rec buffer sizes to be the same. Only the block sizes need to be the same. --- libsndio/sio_oss.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libsndio/sio_oss.c b/libsndio/sio_oss.c index 4ba910c..7199782 100644 --- a/libsndio/sio_oss.c +++ b/libsndio/sio_oss.c @@ -521,17 +521,18 @@ sio_oss_getpar(struct sio_hdl *sh, struct sio_par *par) hdl->sio.eof = 1; return 0; } - par->round = rbi.fragsize / (par->rchan * par->bps); - par->bufsz = rbi.fragstotal * par->round; + if (!(hdl->sio.mode & SIO_PLAY)) { + par->round = rbi.fragsize / (par->rchan * par->bps); + par->bufsz = rbi.fragstotal * par->round; + } } par->appbufsz = par->bufsz; #ifdef DEBUG if ((hdl->sio.mode & (SIO_REC | SIO_PLAY)) == (SIO_REC | SIO_PLAY)) { - if (pbi.fragstotal != rbi.fragstotal || - pbi.fragsize != rbi.fragsize) { + if (pbi.fragsize != rbi.fragsize) { DPRINTF("sio_oss_getpar: frag size/count mismatch\n" - "play: size = %d, count = %d\n" - "rec: size = %d, count = %d\n", + "play: count = %d, size = %d\n" + "rec: count = %d, size = %d\n", pbi.fragstotal, pbi.fragsize, rbi.fragstotal, rbi.fragsize); hdl->sio.eof = 1;