diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-21 20:07:30 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-21 20:07:30 +0100 |
commit | cf8e4015b3ef777b9fe1526eae7f4431116109ee (patch) | |
tree | 5c69650b987525ec75a47cd1dfa0bf9cd5413f32 /plugins/alsa | |
parent | 995453d8f0892062a29c90b7163b6e52803f08f2 (diff) |
changed alsa buffer size calculation
Diffstat (limited to 'plugins/alsa')
-rw-r--r-- | plugins/alsa/alsa.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c index 0709fd46..6c806f51 100644 --- a/plugins/alsa/alsa.c +++ b/plugins/alsa/alsa.c @@ -473,6 +473,14 @@ palsa_thread (void *context) { /* deliver the data */ // FIXME: under some conditions, frames_to_deliver may become huge // like 20M. this case is not handled here. + if (frames_to_deliver < 1024) { + trace ("alsa: frames_to_deliver clipped from %d to 1024\n", frames_to_deliver); + frames_to_deliver = 1024; + } + else if (frames_to_deliver > 2048) { + trace ("alsa: frames_to_deliver clipped from %d to 2048\n", frames_to_deliver); + frames_to_deliver = 2048; + } char buf[frames_to_deliver*4]; palsa_callback (buf, frames_to_deliver*4); if ((err = snd_pcm_writei (audio, buf, frames_to_deliver)) < 0) { |