diff options
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() |