summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audiobackend-pulse.cc5
-rw-r--r--src/audiobackend-pulse.h2
2 files changed, 5 insertions, 2 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);
}
diff --git a/src/audiobackend-pulse.h b/src/audiobackend-pulse.h
index b375a4f..01a8a68 100644
--- a/src/audiobackend-pulse.h
+++ b/src/audiobackend-pulse.h
@@ -50,7 +50,7 @@ private:
volatile bool running;
- char read_buffer[4096];
+ char read_buffer[16000];
volatile unsigned int pread;
volatile unsigned int pwrite;
};