summaryrefslogtreecommitdiff
path: root/src/audiobackend-pulse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/audiobackend-pulse.cc')
-rw-r--r--src/audiobackend-pulse.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/audiobackend-pulse.cc b/src/audiobackend-pulse.cc
index 5ec4865..a74377d 100644
--- a/src/audiobackend-pulse.cc
+++ b/src/audiobackend-pulse.cc
@@ -98,7 +98,10 @@ void AudioBackendPulse::run()
int AudioBackendPulse::read(char *pcm, size_t maxsize)
{
// Wait until enough audio data has been read by the thread.
- while((pread + maxsize) < pwrite) {
+ if(pread == 0) pread = pwrite;
+
+ while((pread + maxsize) > pwrite) {
+ printf("sleeping\n");
usleep(1000);
}