diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-09-26 08:40:35 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-09-26 08:40:35 +0200 |
commit | c0e7c39e84f528929eb334166fb3daf93793974c (patch) | |
tree | aafb07f00bde20b78fa0f33945df497c0a5d2337 /src/sink.cc | |
parent | e87836cbb0001bec22326667456b20dca9fe2834 (diff) |
Clean up - ready for release.
Diffstat (limited to 'src/sink.cc')
-rw-r--r-- | src/sink.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/sink.cc b/src/sink.cc index 4f7cd0f..779dd38 100644 --- a/src/sink.cc +++ b/src/sink.cc @@ -45,22 +45,16 @@ int Sink::writeSamples(const char *pcm, size_t size) { int rc; - /* - if(size < frames * sizeof(short) * channels) { - throw PcmBufferTooSmall(); - } - */ - rc = snd_pcm_writei(handle, pcm, size / sizeof(short)); if(rc == -EPIPE) { // EPIPE means overrun - //snd_pcm_prepare(handle); + snd_pcm_prepare(handle); return -2; } else if (rc < 0) { return -1; // Read Error } - return rc * sizeof(short) /* * channels */ ; + return rc * sizeof(short) * _channels; } unsigned int Sink::samplerate() |