From 23f2217e765e14ad2c2a4192d8c57839d657ac6b Mon Sep 17 00:00:00 2001 From: Holger Steinhaus Date: Thu, 12 Nov 2015 11:05:05 +0100 Subject: do not try any CAM steal voodoo if not at least one CAM is present. This change resolves the nasty "retrying" message generated by VDR's cDevice::SwitchChannel() --- device.c | 3 ++- mcli.c | 5 +++++ mcli.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/device.c b/device.c index 92405dc..e47014c 100644 --- a/device.c +++ b/device.c @@ -538,10 +538,11 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) } else { m_disabletimeout = TEMP_DISABLE_TIMEOUT_DEFAULT; } - bool cam_force=true; + bool cam_force = m_mcli && m_mcli->CAMPresent() && LiveView; if(cam_force && !CheckCAM(Channel, true)) { #ifdef DEBUG_TUNE dsyslog("Mcli::%s: No CAM on DVB %d available even after tried to steal one\n", __FUNCTION__, CardIndex () + 1); + dsyslog("CAMPresent: %d\n", m_mcli->CAMPresent()); #endif return false; } diff --git a/mcli.c b/mcli.c index 1455e1c..c29b2c7 100644 --- a/mcli.c +++ b/mcli.c @@ -122,6 +122,7 @@ cPluginMcli::cPluginMcli (void) m_recv_init_done = 0; m_mld_init_done = 0; m_api_init_done = 0; + m_cam_present = false; memset (m_cam_pool, 0, sizeof (cam_pool_t) * CAM_POOL_MAX); for(i=0; icam[j].flags) { case CA_SINGLE: case CA_MULTI_SID: + m_cam_present = true; + dsyslog("Found CAM"); cp->max = 1; break; case CA_MULTI_TRANSPONDER: + dsyslog("Found CAM"); + m_cam_present = true; cp->max = nci->cam[j].max_sids; break; } diff --git a/mcli.h b/mcli.h index a62fffe..36efb68 100644 --- a/mcli.h +++ b/mcli.h @@ -96,6 +96,7 @@ class cPluginMcli:public cPlugin, public cThread int m_recv_init_done; int m_mld_init_done; int m_api_init_done; + bool m_cam_present; tuner_pool_t m_tuner_pool[TUNER_POOL_MAX]; tuner_pool_t *TunerAvailableInt(fe_type_t type, int pos); @@ -158,6 +159,7 @@ class cPluginMcli:public cPlugin, public cThread cam_pool_t *CAMAlloc (const char *uuid=NULL, int slot=-1); int CAMFree (cam_pool_t *cp); bool CAMSteal(const char *uuid=NULL, int slot=-1, bool force=false); + bool CAMPresent() { return m_cam_present; } satellite_list_t *TunerFindSatList(const netceiver_info_t *nc_info, const char *SatelliteListName) const; bool SatelitePositionLookup(const satellite_list_t *satlist, int pos) const; -- cgit v1.2.3