From: leslie Date: Sun, 4 Sep 2011 03:11:46 +0000 (+0800) Subject: fix detecting FullTS mode on HD device X-Git-Tag: upstream/620~36 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=83d5bf1e3b929193ab82614269c50fa99501a337;p=sasc-ng.git fix detecting FullTS mode on HD device --- diff --git a/device-hd.c b/device-hd.c index 3469a8c..bc13996 100644 --- a/device-hd.c +++ b/device-hd.c @@ -45,9 +45,6 @@ SCAPIVERSTAG(); #define DVBDEVICE cDvbHdFfDevice #define OWN_SETCA #include "device-tmpl.c" -#undef SCDEVICE -#undef DVBDEVICE -#undef OWN_SETCA bool cScDvbHdFfDevice::SetCaDescr(ca_descr_t *ca_descr, bool initial) { diff --git a/device-sd.c b/device-sd.c index 9d6190f..3adfa48 100644 --- a/device-sd.c +++ b/device-sd.c @@ -43,13 +43,15 @@ SCAPIVERSTAG(); #include "../dvbsddevice/dvbsdffdevice.h" #define SCDEVICE cScDvbSdFfDevice #define DVBDEVICE cDvbSdFfDevice +#define OWN_FULLTS #define OWN_SETCA #define OWN_DUMPAV #include "device-tmpl.c" -#undef SCDEVICE -#undef DVBDEVICE -#undef OWN_SETCA -#undef OWN_DUMPAV + +bool cScDvbSdFfDevice::CheckFullTs(void) +{ + return IsPrimaryDevice() && HasDecoder(); +} bool cScDvbSdFfDevice::SetCaDescr(ca_descr_t *ca_descr, bool initial) { diff --git a/device-tmpl.c b/device-tmpl.c index adac307..9e84936 100644 --- a/device-tmpl.c +++ b/device-tmpl.c @@ -58,6 +58,7 @@ public: virtual bool HasCi(void); void LateInit(void); void EarlyShutdown(void); + bool CheckFullTs(void); #else cCam *Cam(void) { return cam; } #endif //!SASC @@ -125,6 +126,13 @@ void SCDEVICE::EarlyShutdown(void) delete hwciadapter; hwciadapter=0; } +#ifndef OWN_FULLTS +bool SCDEVICE::CheckFullTs(void) +{ + return false; +} +#endif //!OWN_FULLTS + void SCDEVICE::LateInit(void) { int n=CardIndex(); @@ -139,10 +147,8 @@ void SCDEVICE::LateInit(void) softcsa=true; } if(softcsa) { - if(IsPrimaryDevice() && HasDecoder()) { - PRINTF(L_GEN_INFO,"Enabling hybrid full-ts mode on card %s",devId); - fullts=true; - } + fullts=CheckFullTs(); + if(fullts) PRINTF(L_GEN_INFO,"Enabling hybrid full-ts mode on card %s",devId); else PRINTF(L_GEN_INFO,"Using software decryption on card %s",devId); } if(fd_ca2>=0) hwciadapter=cDvbCiAdapter::CreateCiAdapter(this,fd_ca2); @@ -210,3 +216,9 @@ bool SCDEVICE::GetTSPacket(uchar *&Data) } #endif // !SASC + +#undef SCDEVICE +#undef DVBDEVICE +#undef OWN_SETCA +#undef OWN_DUMPAV +#undef OWN_FULLTS diff --git a/device.c b/device.c index b1cc01f..2d7eac3 100644 --- a/device.c +++ b/device.c @@ -144,14 +144,17 @@ cScDevicePlugin::~cScDevicePlugin() #define SCDEVICE cScDvbDevice #define DVBDEVICE cDvbDevice #if APIVERSNUM < 10711 +#define OWN_FULLTS #define OWN_SETCA #endif #include "device-tmpl.c" -#undef SCDEVICE -#undef DVBDEVICE -#undef OWN_SETCA #if APIVERSNUM < 10711 +bool cScDvbDevice::CheckFullTs(void) +{ + return IsPrimaryDevice() && HasDecoder(); +} + bool cScDvbDevice::SetCaDescr(ca_descr_t *ca_descr, bool initial) { cMutexLock lock(&cafdMutex);