X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb_ci%2Fdvbci.cpp;h=f6462620e882d165fa7b05a7e9cee75b1125c1c7;hp=9c4e0ac20893773f01f8a744757b38ca30b16ba9;hb=0d8132d3512dbf77d817aa8fb6684384155b642e;hpb=e794d772380ab8b74a2459a07d2f61b49e3a1cf0 diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 9c4e0ac..f646262 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -6,6 +6,7 @@ #include #include +#include // access to python config #include #include #include @@ -217,6 +218,24 @@ void eDVBCIInterfaces::ciRemoved(eDVBCISlot *slot) } } +static bool canDescrambleMultipleServices(int slotid) +{ + char configStr[255]; + snprintf(configStr, 255, "config.ci%d.canDescrambleMultipleServices", slotid); + std::string str; + ePythonConfigQuery::getConfigValue(configStr, str); + eDebug("str is %s", str.empty()?"empty" : str.c_str()); + if ( str == "auto" ) + { + std::string appname = eDVBCI_UI::getInstance()->getAppName(slotid); + if (appname.find("AlphaCrypt") != std::string::npos) + return true; + } + else if (str == "yes") + return true; + return false; +} + void eDVBCIInterfaces::recheckPMTHandlers() { // eDebug("recheckPMTHAndlers()"); @@ -278,7 +297,6 @@ void eDVBCIInterfaces::recheckPMTHandlers() { if ( tmp->cislot ) { - bool canHandleMultipleServices=false; eServiceReferenceDVB ref2; tmp->pmthandler->getServiceReference(ref2); eDVBChannelID s1, s2; @@ -286,15 +304,8 @@ void eDVBCIInterfaces::recheckPMTHandlers() { ref.getChannelID(s1); ref2.getChannelID(s2); - // FIXME .. build a "ci can handle multiple services" config entry - // Yes / No / Auto - if ( eDVBCI_UI::getInstance()->getAppName(ci_it->getSlotID()) == "AlphaCrypt" ) - { - canHandleMultipleServices = true; - eDebug("Alphacrypt can handle multiple services"); - } } - if (ref == ref2 || (s1 == s2 && canHandleMultipleServices) ) + if (ref == ref2 || (s1 == s2 && canDescrambleMultipleServices(ci_it->getSlotID()))) { it->cislot = tmp->cislot; ++it->cislot->use_count;