summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-04-15 16:55:15 +0200
committerJohns <johns98@gmx.net>2013-04-15 16:55:15 +0200
commitc0286b3ab4a0982000756fd32d607f50889ffe02 (patch)
tree2b0773503447c00b587f079760700662aadafa29 /audio.c
parent9dd248f9d0ad9df9cc3413b2ba92dcbc03aa8fd3 (diff)
downloadvdr-plugin-softhddevice-c0286b3ab4a0982000756fd32d607f50889ffe02.tar.gz
vdr-plugin-softhddevice-c0286b3ab4a0982000756fd32d607f50889ffe02.tar.bz2
Fix "broken driver" message if empty ring buffer.
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c13
1 files changed, 8 insertions, 5 deletions
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;