summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-06-09 10:32:09 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-06-09 10:32:09 +0200
commit9abd07af9a2e834b7a3ffd8a32e56ba847581931 (patch)
treee7da660845d9d69129a4d9276d736ad215a5af50
parenta9b2afd28b878f932f98983e5e4e4f780ac6a7fe (diff)
downloadvdr-9abd07af9a2e834b7a3ffd8a32e56ba847581931.tar.gz
vdr-9abd07af9a2e834b7a3ffd8a32e56ba847581931.tar.bz2
Fixed replaying in case the driver reports EAGAIN
-rw-r--r--dvbapi.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/dvbapi.c b/dvbapi.c
index 80f66bdf..dc71a97f 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.c 1.69 2001/06/03 13:07:20 kls Exp $
+ * $Id: dvbapi.c 1.70 2001/06/09 10:32:09 kls Exp $
*/
#include "dvbapi.h"
@@ -742,14 +742,16 @@ void cReplayBuffer::Output(void)
while (r > 0 && Busy() && !blockOutput) {
cFile::FileReadyForWriting(videoDev, 100);
int w = write(videoDev, p, r);
- if (w < 0) {
+ if (w > 0) {
+ p += w;
+ r -= w;
+ fileOffset += w;
+ }
+ else if (w < 0 && errno != EAGAIN) {
LOG_ERROR;
Stop();
return;
}
- p += w;
- r -= w;
- fileOffset += w;
}
}
if (blockOutput > 1)
@@ -1109,13 +1111,15 @@ void cTransferBuffer::Output(void)
uchar *p = b;
while (r > 0 && Busy()) {
int w = write(toDevice, p, r);
- if (w < 0) {
+ if (w > 0) {
+ p += w;
+ r -= w;
+ }
+ else if (w < 0 && errno != EAGAIN) {
LOG_ERROR;
Stop();
return;
}
- p += w;
- r -= w;
}
}
else