1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a race condition when starting 'Transfer Mode'

This commit is contained in:
Klaus Schmidinger 2002-09-22 09:52:38 +02:00
parent 95685c842a
commit f3af8e065a
2 changed files with 7 additions and 4 deletions

View File

@ -1516,3 +1516,4 @@ Video Disk Recorder Revision History
This is the diff for the 'setup' example that comes with VDR, so your line This is the diff for the 'setup' example that comes with VDR, so your line
numbers may be different. numbers may be different.
- Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid). - Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid).
- Fixed a race condition when starting 'Transfer Mode'.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "transfer.h"
@ -47,9 +47,11 @@ void cTransfer::Activate(bool On)
void cTransfer::Receive(uchar *Data, int Length) void cTransfer::Receive(uchar *Data, int Length)
{ {
if (IsAttached()) {
int p = ringBuffer->Put(Data, Length); int p = ringBuffer->Put(Data, Length);
if (p != Length && active) if (p != Length && active)
esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p); esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p);
}
} }
void cTransfer::Action(void) void cTransfer::Action(void)