diff options
author | Martin Panter <vadmium à gmail·com> | 2012-04-17 14:09:17 +0000 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-03 19:14:45 +0200 |
commit | da1d59670bd56b655b1c62d29a8a0401d9557168 (patch) | |
tree | 9af1f706ed2400f0beca60a68146fee34de856e0 /plugins/alsa | |
parent | 20f3f803298629d918135d88888c2c5ca281fe5f (diff) |
Don’t divide sample rate by number of channels
With stereo (two channel) output, the sleep was only allowing just over half
a "period" of frames to drain. Reduced processor usage a little bit, from
4.5 percent to 2.6 percent.
Diffstat (limited to 'plugins/alsa')
-rw-r--r-- | plugins/alsa/alsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c index 3579e9c3..618465b7 100644 --- a/plugins/alsa/alsa.c +++ b/plugins/alsa/alsa.c @@ -677,7 +677,7 @@ palsa_thread (void *context) { UNLOCK; int sleeptime = period_size-frames_to_deliver; if (sleeptime > 0 && plugin.fmt.samplerate > 0 && plugin.fmt.channels > 0) { - usleep (sleeptime * 1000 / plugin.fmt.samplerate / plugin.fmt.channels * 1000); + usleep (sleeptime * 1000 / plugin.fmt.samplerate * 1000); } } } |