summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--audio.c13
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d57bd67..ddf7170 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ Fix "broken driver" message if empty ring buffer.
Enable seamless audio track change.
Fix bug #1302: Unsupported pixel format crash.
Fix the fix, when sillpicture is called in suspend mode.
diff --git a/audio.c b/audio.c
index fa518d5..a38377d 100644
--- a/audio.c
+++ b/audio.c
@@ -2033,10 +2033,10 @@ static void *AudioPlayHandlerThread(void *dummy)
pthread_mutex_unlock(&AudioMutex);
Debug(3, "audio: ----> %dms start\n", (AudioUsedBytes() * 1000)
- / (!AudioRing[AudioRingRead].HwSampleRate +
- !AudioRing[AudioRingRead].HwChannels +
- AudioRing[AudioRingRead].HwSampleRate *
- AudioRing[AudioRingRead].HwChannels * AudioBytesProSample));
+ / (!AudioRing[AudioRingWrite].HwSampleRate +
+ !AudioRing[AudioRingWrite].HwChannels +
+ AudioRing[AudioRingWrite].HwSampleRate *
+ AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample));
do {
int filled;
@@ -2069,7 +2069,10 @@ static void *AudioPlayHandlerThread(void *dummy)
Debug(3, "audio: continue after flush\n");
}
// try to play some samples
- err = AudioUsedModule->Thread();
+ err = 0;
+ if (RingBufferUsedBytes(AudioRing[AudioRingRead].RingBuffer)) {
+ err = AudioUsedModule->Thread();
+ }
// underrun, check if new ring buffer is available
if (!err) {
int passthrough;