summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-09-22 09:52:38 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-09-22 09:52:38 +0200
commitf3af8e065a6022ca7234bd6c60e061d2064a6dff (patch)
treefd089a644b148694f523c8ea0f74218895dd3be4
parent95685c842a9333cff040e8d788c7f99ae61b2774 (diff)
downloadvdr-f3af8e065a6022ca7234bd6c60e061d2064a6dff.tar.gz
vdr-f3af8e065a6022ca7234bd6c60e061d2064a6dff.tar.bz2
Fixed a race condition when starting 'Transfer Mode'
-rw-r--r--HISTORY1
-rw-r--r--transfer.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/HISTORY b/HISTORY
index 2d41bd02..59c4e459 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1516,3 +1516,4 @@ Video Disk Recorder Revision History
This is the diff for the 'setup' example that comes with VDR, so your line
numbers may be different.
- Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid).
+- Fixed a race condition when starting 'Transfer Mode'.
diff --git a/transfer.c b/transfer.c
index 3b0b6360..bd4390bc 100644
--- a/transfer.c
+++ b/transfer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: transfer.c 1.2 2002/06/23 12:56:49 kls Exp $
+ * $Id: transfer.c 1.3 2002/09/22 09:50:48 kls Exp $
*/
#include "transfer.h"
@@ -47,9 +47,11 @@ void cTransfer::Activate(bool On)
void cTransfer::Receive(uchar *Data, int Length)
{
- int p = ringBuffer->Put(Data, Length);
- if (p != Length && active)
- esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p);
+ if (IsAttached()) {
+ int p = ringBuffer->Put(Data, Length);
+ if (p != Length && active)
+ esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p);
+ }
}
void cTransfer::Action(void)