summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-02-16 15:10:39 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2003-02-16 15:10:39 +0100
commit16ce9369966e802908766074f393c0a4783aaeae (patch)
tree3b1e68abf11d7caef55b913adea19a3b0d10b003
parent9c04942eaac18f9a494c5ace7f3e73e62a820c47 (diff)
downloadvdr-16ce9369966e802908766074f393c0a4783aaeae.tar.gz
vdr-16ce9369966e802908766074f393c0a4783aaeae.tar.bz2
Speeded up initial CAM connection after channel change
-rw-r--r--dvbdevice.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index 92356ada..ba608706 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 1.45 2003/02/16 10:58:59 kls Exp $
+ * $Id: dvbdevice.c 1.46 2003/02/16 15:10:39 kls Exp $
*/
#include "dvbdevice.h"
@@ -73,6 +73,7 @@ private:
cChannel channel;
const char *diseqcCommands;
bool active;
+ time_t startTime;
eTunerStatus tunerStatus;
cMutex mutex;
cCondVar newSet;
@@ -95,6 +96,7 @@ cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCi
diseqcCommands = NULL;
active = false;
tunerStatus = tsIdle;
+ startTime = time(NULL);
Start();
}
@@ -118,7 +120,9 @@ void cDvbTuner::Set(const cChannel *Channel, bool Tune)
if (Tune)
tunerStatus = tsSet;
else if (tunerStatus == tsCam)
- tunerStatus = tsLocked;
+ tunerStatus = tsTuned;
+ if (Channel->Ca())
+ startTime = time(NULL);
newSet.Broadcast();
}
@@ -237,7 +241,6 @@ bool cDvbTuner::SetFrontend(void)
void cDvbTuner::Action(void)
{
- time_t StartTime = time(NULL);
dsyslog("tuner thread started on device %d (pid=%d)", cardIndex + 1, getpid());
active = true;
while (active) {
@@ -276,8 +279,10 @@ void cDvbTuner::Action(void)
CaPmt.AddPid(channel.Apid2());
if (channel.Dpid1())
CaPmt.AddPid(channel.Dpid1());
- if (ciHandler->SetCaPmt(CaPmt))
+ if (ciHandler->SetCaPmt(CaPmt)) {
tunerStatus = tsCam;
+ startTime = 0;
+ }
}
}
}
@@ -287,7 +292,7 @@ void cDvbTuner::Action(void)
}
}
// in the beginning we loop more often to let the CAM connection start up fast
- newSet.TimedWait(mutex, (ciHandler && (time(NULL) - StartTime < 20)) ? 100 : 1000);
+ newSet.TimedWait(mutex, (ciHandler && (time(NULL) - startTime < 20)) ? 100 : 1000);
}
dsyslog("tuner thread ended on device %d (pid=%d)", cardIndex + 1, getpid());
}