From ecb0d28d90f58cd6b64a5111e0092c699fd1f280 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 2 Oct 2014 09:01:38 +0200 Subject: Use number of channels in buffer size calculation (ALSA docs is not exactly precise on this matter...) --- src/sink.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sink.cc') diff --git a/src/sink.cc b/src/sink.cc index 779dd38..1211b7e 100644 --- a/src/sink.cc +++ b/src/sink.cc @@ -45,7 +45,7 @@ int Sink::writeSamples(const char *pcm, size_t size) { int rc; - rc = snd_pcm_writei(handle, pcm, size / sizeof(short)); + rc = snd_pcm_writei(handle, pcm, size / sizeof(short) / _channels); if(rc == -EPIPE) { // EPIPE means overrun snd_pcm_prepare(handle); -- cgit v1.2.3