From c0e7c39e84f528929eb334166fb3daf93793974c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 26 Sep 2014 08:40:35 +0200 Subject: Clean up - ready for release. --- src/sink.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/sink.cc') 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() -- cgit v1.2.3