arm different tuner authorization (thx DboxOldie)

This commit is contained in:
Frankenstone
2018-01-29 22:19:37 +01:00
committed by Thilo Graf
parent ac95d67e89
commit 0bd3f48ff2

View File

@@ -43,6 +43,7 @@ ca_slot_info_t info;
#endif #endif
#if HAVE_ARM_HARDWARE #if HAVE_ARM_HARDWARE
const char ci_path[] = "/dev/ci%d"; const char ci_path[] = "/dev/ci%d";
static int last_source = -1;
#endif #endif
static bool checkLiveSlot = false; static bool checkLiveSlot = false;
static bool CertChecked = false; static bool CertChecked = false;
@@ -927,6 +928,8 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char * cabuf,
setInputSource((eDVBCISlot*)(*it), false); setInputSource((eDVBCISlot*)(*it), false);
} }
} }
if (!(*it)->init)
last_source = (int)source;
} }
#endif #endif
printf("No free ci-slot\n"); printf("No free ci-slot\n");
@@ -1192,6 +1195,7 @@ void cCA::ModuleReset(enum CA_SLOT_TYPE, uint32_t slot)
(*it)->status = eStatusReset; (*it)->status = eStatusReset;
usleep(200000); usleep(200000);
#if HAVE_ARM_HARDWARE #if HAVE_ARM_HARDWARE
last_source = (int)(*it)->source;
setInputSource((eDVBCISlot*)(*it), false); setInputSource((eDVBCISlot*)(*it), false);
#endif #endif
if ((*it)->hasCCManager) if ((*it)->hasCCManager)
@@ -1284,6 +1288,7 @@ void cCA::ci_removed(eDVBCISlot* slot)
{ {
printf("cam (%d) status changed ->cam now _not_ present\n", slot->slot); printf("cam (%d) status changed ->cam now _not_ present\n", slot->slot);
#if HAVE_ARM_HARDWARE #if HAVE_ARM_HARDWARE
last_source = (int)slot->source;
setInputSource(slot, false); setInputSource(slot, false);
#endif #endif
if (slot->hasCCManager) if (slot->hasCCManager)
@@ -1383,7 +1388,7 @@ void cCA::slot_pollthread(void *c)
} }
#endif #endif
ci_inserted(slot); ci_inserted(slot);
setInputSource(slot, true); //setInputSource(slot, true);
goto FROM_FIRST; goto FROM_FIRST;
} }
} }
@@ -1594,6 +1599,14 @@ FROM_FIRST:
break; break;
} /* switch(slot->status) */ } /* switch(slot->status) */
#endif /* end Duckbox */ #endif /* end Duckbox */
#if HAVE_ARM_HARDWARE
if (!slot->init && slot->camIsReady && last_source > -1)
{
slot->source = (u8)last_source;
setInputSource(slot, true);
last_source = -1;
}
#endif
if (slot->hasCAManager && slot->hasAppManager && !slot->init) if (slot->hasCAManager && slot->hasAppManager && !slot->init)
{ {
slot->init = true; slot->init = true;
@@ -1631,7 +1644,7 @@ FROM_FIRST:
slot->ccmgrSession->resendKey(slot); slot->ccmgrSession->resendKey(slot);
} }
/* slow down for hd51 to avoid high cpu load */ /* slow down for hd51 to avoid high cpu load */
if (wait && slot->init) if (wait && slot->init && !slot->mmiOpened)
usleep(300000); usleep(300000);
} }
} }