From 4ec863810bd0a4a96a6520ce4b8639333756f592 Mon Sep 17 00:00:00 2001 From: leslie Date: Sun, 16 Aug 2009 18:02:35 +0800 Subject: [PATCH] don't update CA descr on idle handler --- cam.c | 49 ++++++++++++++++++++----------------------------- cam.h | 2 ++ 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/cam.c b/cam.c index c01fd79..96d517c 100644 --- a/cam.c +++ b/cam.c @@ -794,6 +794,15 @@ bool cCaDescr::operator== (const cCaDescr &cd) const return len==cd.len && (len==0 || memcmp(descr,cd.descr,len)==0); } +cString cCaDescr::ToString(void) +{ + if(!descr) return ""; + char *str=AUTOARRAY(char,len*3+8); + int q=sprintf(str,"%02X",descr[0]); + for(int i=1; ipid,*pid->caDescr.ToString()); +} + bool cPrg::SimplifyCaDescr(void) { //XXX -{ PRINTF(L_CORE_PIDS,"SimplyCa entry pidCa=%d",HasPidCaDescr()); -const unsigned char *d; -int l; -d=caDescr.Get(l); -if(d) LDUMP(L_CORE_PIDS,d,l,"prgca:"); -else PRINTF(L_CORE_PIDS,"prgca: "); -for(cPrgPid *pid=pids.First(); pid; pid=pids.Next(pid)) { - d=pid->caDescr.Get(l); - if(d) LDUMP(L_CORE_PIDS,d,l,"pidca %04x:",pid->pid); - else PRINTF(L_CORE_PIDS,"pidca %04x: ",pid->pid); - } -} +DumpCaDescr(L_CORE_PIDS); //XXX if(HasPidCaDescr()) { @@ -852,19 +857,8 @@ for(cPrgPid *pid=pids.First(); pid; pid=pids.Next(pid)) { } //XXX -{ PRINTF(L_CORE_PIDS,"SimplyCa exit pidCa=%d",HasPidCaDescr()); -const unsigned char *d; -int l; -d=caDescr.Get(l); -if(d) LDUMP(L_CORE_PIDS,d,l,"prgca:"); -else PRINTF(L_CORE_PIDS,"prgca: "); -for(cPrgPid *pid=pids.First(); pid; pid=pids.Next(pid)) { - d=pid->caDescr.Get(l); - if(d) LDUMP(L_CORE_PIDS,d,l,"pidca %04x:",pid->pid); - else PRINTF(L_CORE_PIDS,"pidca %04x: ",pid->pid); - } -} +DumpCaDescr(L_CORE_PIDS); //XXX return HasPidCaDescr(); @@ -1015,10 +1009,6 @@ void cEcmHandler::SetPrg(cPrg *Prg) prg.pids.Clear(); trigger=true; } - if(!(prg.caDescr==Prg->caDescr)) { - prg.caDescr.Set(&Prg->caDescr); - trigger=true; - } if(Prg->HasPidCaDescr()) PRINTF(L_GEN_DEBUG,"internal: pid specific caDescr not supported at this point (sid=%d)",Prg->sid); LBSTART(L_CORE_PIDS); @@ -1060,6 +1050,7 @@ void cEcmHandler::SetPrg(cPrg *Prg) LBPUT(" %s=%04x",TYPENAME(pid->type),pid->pid); LBEND(); if(!IsIdle()) { + if(!(prg.caDescr==Prg->caDescr)) prg.caDescr.Set(&Prg->caDescr); trigger=true; triggerMode=0; if(wasIdle) PRINTF(L_CORE_ECM,"%s: is no longer idle",id); @@ -1103,7 +1094,7 @@ void cEcmHandler::Process(cPidFilter *filter, unsigned char *data, int len) filterCaDescr.Set(&prg.caDescr); ecmUpd=true; //XXX -PRINTF(L_CORE_ECM,"%s: new caDescr",id); +PRINTF(L_CORE_ECM,"%s: new caDescr: %s",id,*filterCaDescr.ToString()); } triggerMode=-1; } diff --git a/cam.h b/cam.h index 61cfef3..56b81ff 100644 --- a/cam.h +++ b/cam.h @@ -72,6 +72,7 @@ public: void Clear(void); bool operator== (const cCaDescr &arg) const; void Join(const cCaDescr *cd, bool rev=false); + cString ToString(void); }; // ---------------------------------------------------------------- @@ -106,6 +107,7 @@ public: bool HasPidCaDescr(void) const { return pidCaDescr; } void SetPidCaDescr(bool val) { pidCaDescr=val; } bool SimplifyCaDescr(void); + void DumpCaDescr(int c); }; // ---------------------------------------------------------------- -- 2.39.5