diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-08-02 20:43:30 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-08-02 20:43:30 +0200 |
commit | 90fb73a91936ede98ccedda073929397ddf842b1 (patch) | |
tree | c83b8f8ebdfdea527f01b6afede8f90d03bd0fa4 /src/audioout.cc | |
parent | f83b395168155d0421dbc093a37bd075dc51ed53 (diff) |
Diffstat (limited to 'src/audioout.cc')
-rw-r--r-- | src/audioout.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/audioout.cc b/src/audioout.cc index 0495a2c..b0ab3d7 100644 --- a/src/audioout.cc +++ b/src/audioout.cc @@ -29,8 +29,6 @@ #define T(x, msg) if(x < 0) { printf("%s failed: %s\n", msg, snd_strerror(x)); fflush(stdout); } -#define BUFSZ 40960 - AudioOut::AudioOut(std::string device, unsigned int srate, int channels) { handle = NULL; @@ -83,5 +81,8 @@ AudioOut::~AudioOut() void AudioOut::write(sample_t *samples, size_t size) { // Write the interleaved buffer to the soundcard - snd_pcm_writei(handle, samples, size); + size_t sz = 0; + while(size > sz) { + sz += snd_pcm_writei(handle, samples + sz, size - sz); + } } |