]> www.vanbest.org Git - sasc-ng.git/commitdiff
fix ecmPri creation related to cached entries
authorleslie <unknown>
Sat, 6 Mar 2010 13:44:37 +0000 (21:44 +0800)
committerleslie <unknown>
Sat, 6 Mar 2010 13:44:37 +0000 (21:44 +0800)
cam.c

diff --git a/cam.c b/cam.c
index 804dceee7f28e9c9843ff1a1cb08f9a7592986ff..cd00713c1f1a3e5f05c9fe77da70702485235712 100644 (file)
--- a/cam.c
+++ b/cam.c
@@ -1315,6 +1315,14 @@ void cEcmHandler::AddEcmPri(cEcmInfo *n)
       if(n->Cached() && (!ScSetup.LocalPriority || pri!=-15)) ep->pri+=20;
       ep->pri=ep->pri*100 + overrides.GetEcmPrio(n->source,n->transponder,n->caId,n->provId);
 
+      // no double entries in ecmPriList
+      for(cEcmPri *epp=ecmPriList.First(); epp; epp=ecmPriList.Next(epp))
+        if(epp->ecm==ep->ecm && epp->sysIdent==ep->sysIdent) {
+          delete ep; ep=0;
+          break;
+          }
+      }
+    if(ep) {
       // keep ecmPriList sorted
       cEcmPri *eppp, *epp=ecmPriList.First();
       if(!epp || epp->pri<ep->pri)
@@ -1444,6 +1452,7 @@ void cEcmHandler::ParseCAInfo(int SysId)
                   if(e->caId==n->caId && e->provId==n->provId) {
                     if(e->AddCaDescr(n) && dolog) LBPUT("(updated) ");
                     if(dolog) LBPUT("(already present)");
+                    AddEcmPri(n);
                     delete n; n=0;
                     break;
                     }
@@ -1468,11 +1477,10 @@ void cEcmHandler::ParseCAInfo(int SysId)
         }
       }
     }
-  if(SysId==0xFFFF) {
-    for(cEcmPri *ep=ecmPriList.First(); ep; ep=ecmPriList.Next(ep))
-      PRINTF(L_CORE_ECMPROC,"%s: ecmPriList pri=%d ident=%04x caid=%04x pid=%04x",id,ep->pri,ep->sysIdent,ep->ecm->caId,ep->ecm->ecm_pid);
-    PRINTF(L_CORE_ECMPROC,"%s: ecmPri list end",id);
-    }
+
+  for(cEcmPri *ep=ecmPriList.First(); ep; ep=ecmPriList.Next(ep))
+    PRINTF(L_CORE_ECMPROC,"%s: ecmPriList pri=%d ident=%04x caid=%04x pid=%04x",id,ep->pri,ep->sysIdent,ep->ecm->caId,ep->ecm->ecm_pid);
+  PRINTF(L_CORE_ECMPROC,"%s: ecmPri list end",id);
 }
 
 // -- cCam ---------------------------------------------------------------