]> www.vanbest.org Git - sasc-ng.git/commitdiff
fix trying unwanted systems for entries from ECM cache
authorleslie <unknown>
Sat, 25 Jul 2009 02:39:02 +0000 (10:39 +0800)
committerleslie <unknown>
Sat, 25 Jul 2009 02:39:02 +0000 (10:39 +0800)
cam.c
system.c
system.h

diff --git a/cam.c b/cam.c
index 8b384f2de1d824c3b5b039f89fe2e136469d9b5d..3cc79fb8c40be4598c8a9584b4a2f03595937cbb 100644 (file)
--- 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; 
index 28ed4cef06bc44ccab5550d33e07a917b9bd3dbe..e4d59871955902d570480ddda6b233978c59c060 100644 (file)
--- 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);
index 18cdac91cd5c084237ed1f09c13f845e9c4c8d5e..56c920e48754f61a5e59e2285eb951ac9206b89c 100644 (file)
--- 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);