diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-10-02 09:01:38 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-10-02 09:01:38 +0200 |
commit | ecb0d28d90f58cd6b64a5111e0092c699fd1f280 (patch) | |
tree | 874862402b2bb5e351dc85ac5c4e17e73a1d0c43 /src/source.cc | |
parent | 98fdd847ca736f1ea0f8a15fb9a4d2194c651c61 (diff) |
Use number of channels in buffer size calculation (ALSA docs is not exactly precise on this matter...)
Diffstat (limited to 'src/source.cc')
-rw-r--r-- | src/source.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/source.cc b/src/source.cc index 03faa15..6574970 100644 --- a/src/source.cc +++ b/src/source.cc @@ -46,7 +46,7 @@ int Source::readSamples(char *pcm, size_t maxsize) { int rc; - rc = snd_pcm_readi(handle, pcm, maxsize / sizeof(short)); + rc = snd_pcm_readi(handle, pcm, maxsize / sizeof(short) / _channels); if(rc == -EPIPE) { // EPIPE means overrun snd_pcm_prepare(handle); |