diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-03-17 15:10:57 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-03-17 15:10:57 +0100 |
commit | 62596f991ebf30a61cdbe1de15acd2c63f598149 (patch) | |
tree | 2eeb04febf502fe7de88062ba193f52a6b07c89e /filter.c | |
parent | fd7ccc7627b08ab66122d644cb301aba42ae0c06 (diff) | |
download | vdr-62596f991ebf30a61cdbe1de15acd2c63f598149.tar.gz vdr-62596f991ebf30a61cdbe1de15acd2c63f598149.tar.bz2 |
Improved syncing on sections when parsing the NIT and SDT
Diffstat (limited to 'filter.c')
-rw-r--r-- | filter.c | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: filter.c 1.4 2004/01/11 13:31:34 kls Exp $ + * $Id: filter.c 4.1 2015/03/17 15:04:39 kls Exp $ */ #include "filter.h" @@ -19,22 +19,31 @@ cSectionSyncer::cSectionSyncer(void) void cSectionSyncer::Reset(void) { + lastVersion = thisVersion = 0xFF; + nextNumber = 0; +} + +void cSectionSyncer::Repeat(void) +{ lastVersion = 0xFF; - synced = false; + nextNumber--; } bool cSectionSyncer::Sync(uchar Version, int Number, int LastNumber) { - if (Version == lastVersion) - return false; - if (!synced) { - if (Number != 0) - return false; // sync on first section - synced = true; + if (Version != lastVersion) { + if (Version != thisVersion) { + thisVersion = Version; + nextNumber = 0; + } + if (Number == nextNumber) { + if (Number == LastNumber) + lastVersion = Version; + nextNumber++; + return true; + } } - if (Number == LastNumber) - lastVersion = Version; - return synced; + return false; } // --- cFilterData ----------------------------------------------------------- |