summaryrefslogtreecommitdiff
path: root/filter.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-01-05 14:30:31 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-01-05 14:30:31 +0100
commit2bf718b62f051c0f563fa8ad1d95351b68c5315b (patch)
treed3b44e5c439ba3458caf774dd239f57203ebf266 /filter.c
parent3f5c7e67eac370bfbc37b13779ebd7d9da3c2061 (diff)
downloadvdr-2bf718b62f051c0f563fa8ad1d95351b68c5315b.tar.gz
vdr-2bf718b62f051c0f563fa8ad1d95351b68c5315b.tar.bz2
Enhanced the SDT filter to handle multi part sections
Diffstat (limited to 'filter.c')
-rw-r--r--filter.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/filter.c b/filter.c
index 668b7d3a..56054d36 100644
--- a/filter.c
+++ b/filter.c
@@ -4,12 +4,39 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: filter.c 1.1 2003/12/21 15:26:16 kls Exp $
+ * $Id: filter.c 1.2 2004/01/05 14:30:00 kls Exp $
*/
#include "filter.h"
#include "sections.h"
+// --- cSectionSyncer --------------------------------------------------------
+
+cSectionSyncer::cSectionSyncer(void)
+{
+ Reset();
+}
+
+void cSectionSyncer::Reset(void)
+{
+ lastVersion = 0xFF;
+ synced = false;
+}
+
+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 (Number == LastNumber)
+ lastVersion = Version;
+ return synced;
+}
+
// --- cFilterData -----------------------------------------------------------
cFilterData::cFilterData(void)