diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-05-01 12:50:12 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-05-01 12:50:12 +0200 |
commit | 9491948f04d20f86133dbe8cf8dbd6997aeb5b62 (patch) | |
tree | b59e8bdbdd08d3d9a7057346376ad69142156222 /dvbdevice.c | |
parent | 073268bd45a4a36e0d20ba1a60d585e9cae13e30 (diff) | |
download | vdr-9491948f04d20f86133dbe8cf8dbd6997aeb5b62.tar.gz vdr-9491948f04d20f86133dbe8cf8dbd6997aeb5b62.tar.bz2 |
Fixed handling UNC values
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index 3a900a3a..70a4809b 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 4.9 2017/04/20 14:42:35 kls Exp $ + * $Id: dvbdevice.c 4.10 2017/05/01 12:48:55 kls Exp $ */ #include "dvbdevice.h" @@ -844,13 +844,16 @@ int cDvbTuner::GetSignalQuality(void) const // be considered low even if there haven't been any more uncorrected bocks // for quite a while. Unc = lastUncDelta; - int t = time(NULL) - lastUncChange - 2; - if (t > 0) - Unc >>= min(t, 32); + if (Unc > 0) { + int t = time(NULL) - lastUncChange - 2; + if (t > 0) + Unc >>= min(t, int(sizeof(Unc) * 8 - 1)); + if (Unc == 0) + lastUncDelta = 0; #ifdef DEBUG_SIGNALQUALITY - if (Unc > 0) fprintf(stderr, "FE %d/%d: API3 UNC = %u\n", adapter, frontend, Unc); #endif + } break; } if (errno != EINTR) { |