summaryrefslogtreecommitdiff
path: root/sections.c
diff options
context:
space:
mode:
Diffstat (limited to 'sections.c')
-rw-r--r--sections.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/sections.c b/sections.c
index 6b4d490..fb934a8 100644
--- a/sections.c
+++ b/sections.c
@@ -4,11 +4,12 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sections.c 1.2 2004/01/03 12:54:01 kls Exp $
+ * $Id: sections.c 1.4 2004/01/11 13:22:13 kls Exp $
*/
#include "sections.h"
#include <unistd.h>
+#include "channels.h"
#include "device.h"
// --- cFilterHandle----------------------------------------------------------
@@ -28,17 +29,24 @@ cFilterHandle::cFilterHandle(const cFilterData &FilterData)
used = 0;
}
+// --- cSectionHandlerPrivate ------------------------------------------------
+
+class cSectionHandlerPrivate {
+public:
+ cChannel channel;
+ };
+
// --- cSectionHandler -------------------------------------------------------
cSectionHandler::cSectionHandler(cDevice *Device)
:cThread("Section handler")
{
+ shp = new cSectionHandlerPrivate;
device = Device;
active = false;
- source = 0;
- transponder = 0;
statusCount = 0;
on = false;
+ lastIncompleteSection = 0;
Start();
}
@@ -49,6 +57,22 @@ cSectionHandler::~cSectionHandler()
cFilter *fi;
while ((fi = filters.First()) != NULL)
Detach(fi);
+ delete shp;
+}
+
+int cSectionHandler::Source(void)
+{
+ return shp->channel.Source();
+}
+
+int cSectionHandler::Transponder(void)
+{
+ return shp->channel.Transponder();
+}
+
+const cChannel *cSectionHandler::Channel(void)
+{
+ return &shp->channel;
}
void cSectionHandler::Add(const cFilterData *FilterData)
@@ -106,11 +130,10 @@ void cSectionHandler::Detach(cFilter *Filter)
Unlock();
}
-void cSectionHandler::SetSource(int Source, int Transponder)
+void cSectionHandler::SetChannel(const cChannel *Channel)
{
Lock();
- source = Source;
- transponder = Transponder;
+ shp->channel = Channel? *Channel : cChannel();
Unlock();
}
@@ -176,8 +199,10 @@ void cSectionHandler::Action(void)
fi->Process(pid, tid, buf, len);
}
}
- else
+ else if (time(NULL) - lastIncompleteSection > 10) { // log them only every 10 seconds
dsyslog("read incomplete section - len = %d, r = %d", len, r);
+ lastIncompleteSection = time(NULL);
+ }
}
}
}