diff options
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]; |