diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-21 08:56:49 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-21 08:56:49 +0200 |
commit | 6de23d7d96720f89cbc864bbf504fe466e224497 (patch) | |
tree | e0fa92f9f0d7816cfd0eef3507f069758d053300 /ci.c | |
parent | ba3437f7ccbc86f67b8cbfc5a88cc6c3b4fd6ed9 (diff) | |
download | vdr-6de23d7d96720f89cbc864bbf504fe466e224497.tar.gz vdr-6de23d7d96720f89cbc864bbf504fe466e224497.tar.bz2 |
Now waiting at startup until all DVB devices are ready
Diffstat (limited to 'ci.c')
-rw-r--r-- | ci.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 1.25 2005/08/20 12:16:23 kls Exp $ + * $Id: ci.c 1.26 2005/08/20 15:27:35 kls Exp $ */ #include "ci.h" @@ -1354,6 +1354,8 @@ cCiHandler::cCiHandler(int Fd, int NumSlots) hasUserIO = false; for (int i = 0; i < MAX_CI_SESSION; i++) sessions[i] = NULL; + for (int i = 0; i < MAX_CI_SLOT; i++) + moduleReady[i] = false; tpl = new cCiTransportLayer(Fd, numSlots); tc = NULL; } @@ -1506,6 +1508,19 @@ int cCiHandler::CloseAllSessions(int Slot) return result; } +bool cCiHandler::Ready(void) +{ + cMutexLock MutexLock(&mutex); + for (int Slot = 0; Slot < numSlots; Slot++) { + if (moduleReady[Slot]) { + cCiConditionalAccessSupport *cas = (cCiConditionalAccessSupport *)GetSessionByResourceId(RI_CONDITIONAL_ACCESS_SUPPORT, Slot); + if (!cas || !*cas->GetCaSystemIds()) + return false; + } + } + return true; +} + bool cCiHandler::Process(void) { bool result = true; @@ -1543,6 +1558,7 @@ bool cCiHandler::Process(void) } else if (tpl->ModuleReady(Slot)) { dbgprotocol("Module ready in slot %d\n", Slot); + moduleReady[Slot] = true; tpl->NewConnection(Slot); } } |