aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlexandre Ratchov <[email protected]>2012-06-02 19:14:08 +1200
committerMatthew Gregan <[email protected]>2012-06-02 19:14:08 +1200
commit21d9678eb9755761f7a9d26253189b926258de7c (patch)
tree7c1de8c3bafb9634e5949a3a232547bc5c6c3421
parent491b026766cb7488b36b65b916bf80c4eaf2e476 (diff)
downloadcubeb-21d9678eb9755761f7a9d26253189b926258de7c.tar.gz
cubeb-21d9678eb9755761f7a9d26253189b926258de7c.zip
sndio: fix latency calculation and S16BE handling.
-rw-r--r--src/cubeb_sndio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c
index 922a8a9..6f8953c 100644
--- a/src/cubeb_sndio.c
+++ b/src/cubeb_sndio.c
@@ -156,7 +156,6 @@ cubeb_stream_init(cubeb *context,
struct cubeb_stream *s;
struct sio_par wpar, rpar;
DPR("cubeb_stream_init(%s)\n", stream_name);
- unsigned minbufsz = stream_params.rate * 50 / 1000;
size_t size;
s = malloc(sizeof(struct cubeb_stream));
@@ -176,7 +175,7 @@ cubeb_stream_init(cubeb *context,
wpar.le = 1;
break;
case CUBEB_SAMPLE_S16BE:
- wpar.le = 1;
+ wpar.le = 0;
break;
case CUBEB_SAMPLE_FLOAT32NE:
wpar.le = SIO_LE_NATIVE;
@@ -187,7 +186,7 @@ cubeb_stream_init(cubeb *context,
}
wpar.rate = stream_params.rate;
wpar.pchan = stream_params.channels;
- wpar.appbufsz = latency < minbufsz ? minbufsz : latency;
+ wpar.appbufsz = latency * wpar.rate / 1000;
if (!sio_setpar(s->hdl, &wpar) || !sio_getpar(s->hdl, &rpar)) {
sio_close(s->hdl);
free(s);