diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-23 13:40:56 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-23 13:40:56 +0200 |
commit | f0a7e75d8ecee71469ca6b8aa21b22bde909f599 (patch) | |
tree | 94221ad077e2cb2cbb8c14a4fa7b53d666dd7b97 /transfer.c | |
parent | af6b8ff5330851bd12bb1b011fdbd29fead5bf3c (diff) | |
download | vdr-f0a7e75d8ecee71469ca6b8aa21b22bde909f599.tar.gz vdr-f0a7e75d8ecee71469ca6b8aa21b22bde909f599.tar.bz2 |
Taking the complete size of available data into account when deciding whether to clear the transfer buffer to avoid overflows
Diffstat (limited to 'transfer.c')
-rw-r--r-- | transfer.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.c 1.17 2004/10/16 09:22:58 kls Exp $ + * $Id: transfer.c 1.18 2004/10/23 13:35:08 kls Exp $ */ #include "transfer.h" @@ -65,7 +65,7 @@ void cTransfer::Action(void) int Count; uchar *b = ringBuffer->Get(Count); if (b) { - if (Count > TRANSFERBUFSIZE * 2 / 3) { + if (ringBuffer->Available() > TRANSFERBUFSIZE * 9 / 10) { // If the buffer runs full, we have no chance of ever catching up // since the data comes in at the same rate as it goes out (it's "live"). // So let's clear the buffer instead of suffering from permanent |