summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-12-28 11:03:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-12-28 11:03:00 +0100
commit7470253c60f98e654e01de5bd7cc3da893524462 (patch)
tree3155a2b5d122e8a7858ebe6b218e7bd4cb5fd5cf /dvbdevice.c
parent7b2085b575777d1fbcf93acd03a96ae307847611 (diff)
downloadvdr-7470253c60f98e654e01de5bd7cc3da893524462.tar.gz
vdr-7470253c60f98e654e01de5bd7cc3da893524462.tar.bz2
Added a poll to cDvbDevice::PlayVideo() and cDvbDevice::PlayAudio() to avoid excessive CPU load
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index c3fe6868..5be20db2 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 2.7 2008/12/22 10:24:10 kls Exp $
+ * $Id: dvbdevice.c 2.8 2008/12/28 10:59:51 kls Exp $
*/
#include "dvbdevice.h"
@@ -1303,6 +1303,10 @@ int cDvbDevice::PlayVideo(const uchar *Data, int Length)
int w;
do {
w = WriteAllOrNothing(fd_video, Data, Length, 1000, 10);
+ if (w < 0 && errno == EAGAIN) {
+ cPoller Poller(fd_video, true);
+ Poller.Poll(200);
+ }
} while (w != Length);
return w;
}
@@ -1312,6 +1316,10 @@ int cDvbDevice::PlayAudio(const uchar *Data, int Length, uchar Id)
int w;
do {
w = WriteAllOrNothing(fd_audio, Data, Length, 1000, 10);
+ if (w < 0 && errno == EAGAIN) {
+ cPoller Poller(fd_audio, true);
+ Poller.Poll(200);
+ }
} while (w != Length);
return w;
}