diff options
author | Johns <johns98@gmx.net> | 2013-04-15 16:55:15 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-04-15 16:55:15 +0200 |
commit | c0286b3ab4a0982000756fd32d607f50889ffe02 (patch) | |
tree | 2b0773503447c00b587f079760700662aadafa29 /audio.c | |
parent | 9dd248f9d0ad9df9cc3413b2ba92dcbc03aa8fd3 (diff) | |
download | vdr-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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; |