From f6ad49feae940996494aba4c9f542f8cc2e5ab2c Mon Sep 17 00:00:00 2001 From: leslie Date: Sat, 25 Jul 2009 10:39:02 +0800 Subject: [PATCH] fix trying unwanted systems for entries from ECM cache --- cam.c | 6 +++++- system.c | 19 ++++++++++++------- system.h | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cam.c b/cam.c index 8b384f2..3cc79fb 100644 --- a/cam.c +++ b/cam.c @@ -1137,7 +1137,11 @@ cEcmInfo *cEcmHandler::NewEcm(void) void cEcmHandler::AddEcmPri(cEcmInfo *n) { int ident, pri=0; - while((ident=cSystems::FindIdentBySysId(n->caId,!cam->IsSoftCSA(filterCwIndex==0),pri))>0) { + while(1) { + if(!n->Cached()) ident=cSystems::FindIdentBySysId(n->caId,!cam->IsSoftCSA(filterCwIndex==0),pri); + else ident=(pri==0) ? cSystems::FindIdentBySysName(n->caId,!cam->IsSoftCSA(filterCwIndex==0),n->name,pri) : 0; + if(ident<=0) break; + cEcmPri *ep=new cEcmPri; if(ep) { ep->ecm=n; diff --git a/system.c b/system.c index 28ed4ce..e4d5987 100644 --- a/system.c +++ b/system.c @@ -341,13 +341,6 @@ cSystemLink *cSystems::FindByIdent(int ident) return 0; } -cSystem *cSystems::FindBySysName(unsigned short SysId, bool ff, const char *Name) -{ - cSystemLink *sl=FindByName(Name); - if(sl && (!ff || !sl->noFF) && !ScSetup.Ignore(SysId) && sl->CanHandle(SysId)) return sl->Create(); - return 0; -} - cSystem *cSystems::FindBySysId(unsigned short SysId, bool ff, int oldPri) { if(!ScSetup.Ignore(SysId)) { @@ -369,6 +362,18 @@ int cSystems::FindIdentBySysId(unsigned short SysId, bool ff, int &Pri) return 0; } +int cSystems::FindIdentBySysName(unsigned short SysId, bool ff, const char *Name, int &Pri) +{ + if(!ScSetup.Ignore(SysId)) { + cSystemLink *csl=FindByName(Name); + if(csl && (!ff || !csl->noFF) && csl->CanHandle(SysId)) { + Pri=csl->pri; + return csl->sysIdent; + } + } + return 0; +} + cSystem *cSystems::FindBySysIdent(int ident) { cSystemLink *csl=FindByIdent(ident); diff --git a/system.h b/system.h index 18cdac9..56c920e 100644 --- a/system.h +++ b/system.h @@ -174,8 +174,8 @@ private: public: static int Provides(const unsigned short *SysIds, bool ff); static cSystem *FindBySysId(unsigned short SysId, bool ff, int oldPri); - static cSystem *FindBySysName(unsigned short SysId, bool ff, const char *Name); static int FindIdentBySysId(unsigned short SysId, bool ff, int &Pri); + static int FindIdentBySysName(unsigned short SysId, bool ff, const char *Name, int &Pri); static cSystem *FindBySysIdent(int ident); static bool Init(const char *cfgdir); static void Clean(void); -- 2.39.5