diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-10-01 18:56:24 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-10-01 18:56:24 +0200 |
commit | 6d1bc935a6982f045298dc074f0867c2431c3d24 (patch) | |
tree | 33ebf02a13afa41c7e2da14c604ca5e706a25475 /src/soundplayer.cc | |
parent | 0b1a19c17abd0af5adf06b46e25c8bf10a3d81a5 (diff) |
Use buffer size from audiobackend in output code.
Diffstat (limited to 'src/soundplayer.cc')
-rw-r--r-- | src/soundplayer.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soundplayer.cc b/src/soundplayer.cc index 0ae978f..f54ff90 100644 --- a/src/soundplayer.cc +++ b/src/soundplayer.cc @@ -48,8 +48,8 @@ void SoundPlayer::run() { running = true; - short *s = (short*)malloc(buffer_size * sizeof(short)); - memset(s, 0, sizeof(s)); + short *s = (short*)calloc(buffer_size, sizeof(short)); + while(running) { for(int i = 0; i < buffer_size; i++) { s[i] = ringbuffer[pread % RINGBUFFER]; |