diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | device.c | 44 | ||||
-rw-r--r-- | mcast/client/mmi_handler.c | 2 | ||||
-rw-r--r-- | mcast/common/ciparser.c | 8 | ||||
-rw-r--r-- | mcast/common/mld_client.c | 5 | ||||
-rw-r--r-- | mcast/common/recv_ccpp.c | 5 | ||||
-rw-r--r-- | mcli.c | 79 | ||||
-rw-r--r-- | mcli.h | 2 |
8 files changed, 63 insertions, 86 deletions
@@ -23,8 +23,8 @@ TMPDIR ?= /tmp ### The compiler options: -export CFLAGS = $(call PKGCFG,cflags) -fPIC -export CXXFLAGS = $(call PKGCFG,cxxflags) -fPIC +export CFLAGS = $(call PKGCFG,cflags) -fPIC -Wall +export CXXFLAGS = $(call PKGCFG,cxxflags) -fPIC -Wall ### The version number of VDR's plugin API: @@ -87,7 +87,7 @@ cMcliDevice::cMcliDevice (void) m_camref = NULL; InitMcli (); - printf ("Mcli::%s: DVB got device number %d\n", __FUNCTION__, CardIndex () + 1); + dsyslog ("Mcli::%s: DVB got device number %d\n", __FUNCTION__, CardIndex () + 1); } @@ -95,7 +95,7 @@ cMcliDevice::~cMcliDevice () { LOCK_THREAD; StopSectionHandler (); - printf ("Mcli::%s: DVB %d gets destructed\n", __FUNCTION__, CardIndex () + 1); + dsyslog ("Mcli::%s: DVB %d gets destructed\n", __FUNCTION__, CardIndex () + 1); Cancel (0); m_locked.Broadcast (); ExitMcli (); @@ -198,20 +198,20 @@ bool cMcliDevice::SetTempDisable (bool now) } //#endif // printf("Device %d Receiving %d Priority %d\n",CardIndex () + 1, Receiving (true), Priority()); - if(!Receiving (true) && (((time(NULL)-m_last) >= m_disabletimeout)) || now) { + if((!Receiving (true) && (((time(NULL)-m_last) >= m_disabletimeout)) ) || now) { recv_stop (m_r); m_tuned = false; if(GetCaEnable()) { SetCaEnable(false); #ifdef DEBUG_TUNE - printf("Mcli::%s: Releasing CAM on device %d (%s) (disable, %d)\n", __FUNCTION__, CardIndex()+1, m_chan.Name(), now); + dsyslog("Mcli::%s: Releasing CAM on device %d (%s) (disable, %d)\n", __FUNCTION__, CardIndex()+1, m_chan.Name(), now); #endif m_mcli->CAMFree(m_camref); m_camref = NULL; } if(m_tunerref) { #ifdef DEBUG_TUNE - printf("Mcli::%s: Releasing tuner on device %d (%s)\n", __FUNCTION__, CardIndex()+1, m_chan.Name()); + dsyslog("Mcli::%s: Releasing tuner on device %d (%s)\n", __FUNCTION__, CardIndex()+1, m_chan.Name()); #endif m_mcli->TunerFree(m_tunerref, false); m_tunerref = NULL; @@ -310,7 +310,7 @@ bool cMcliDevice::ProvidesSource (int Source) const } } #ifdef DEBUG_TUNE_EXTRA - printf ("Mcli::%s: DVB:%d Type:%d Pos:%d -> %d\n", __FUNCTION__, CardIndex () + 1, type, pos, ret); + dsyslog ("Mcli::%s: DVB:%d Type:%d Pos:%d -> %d\n", __FUNCTION__, CardIndex () + 1, type, pos, ret); #endif return ret; } @@ -362,7 +362,7 @@ bool cMcliDevice::ProvidesTransponder (const cChannel * Channel) const } #ifdef DEBUG_TUNE_EXTRA - printf ("Mcli::%s: DVB:%d S2:%d %s@%p -> %d\n", __FUNCTION__, CardIndex () + 1, s2, Channel->Name (), this, ret); + dsyslog ("Mcli::%s: DVB:%d S2:%d %s@%p -> %d\n", __FUNCTION__, CardIndex () + 1, s2, Channel->Name (), this, ret); #endif return ret; } @@ -387,10 +387,8 @@ bool cMcliDevice::IsTunedToTransponder(const cChannel * Channel) const m_chan.Modulation() == Channel->Modulation() && #endif m_chan.Srate() == Channel->Srate()) { -// printf ("Yes!!!"); return true; } -// printf ("Nope!!!"); return false; } @@ -426,7 +424,7 @@ bool cMcliDevice::ProvidesChannel (const cChannel * Channel, int Priority, bool } if(!CheckCAM(Channel, false)) { #ifdef DEBUG_TUNE - printf ("Mcli::%s: DVB:%d Channel(%p):%s, Prio:%d this->Prio:%d m_chan.Name:%s -> %d\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Priority, this->Priority (), m_chan.Name(), false); + dsyslog ("Mcli::%s: DVB:%d Channel(%p):%s, Prio:%d this->Prio:%d m_chan.Name:%s -> %d\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Priority, this->Priority (), m_chan.Name(), false); #endif return false; } @@ -457,7 +455,7 @@ bool cMcliDevice::ProvidesChannel (const cChannel * Channel, int Priority, bool } #ifdef DEBUG_TUNE - printf ("Mcli::%s: DVB:%d Channel(%p):%s, Prio:%d this->Prio:%d m_chan.Name:%s NeedsDetachReceivers:%d -> %d\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Priority, this->Priority (), m_chan.Name(), needsDetachReceivers, result); + dsyslog ("Mcli::%s: DVB:%d Channel(%p):%s, Prio:%d this->Prio:%d m_chan.Name:%s NeedsDetachReceivers:%d -> %d\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Priority, this->Priority (), m_chan.Name(), needsDetachReceivers, result); #endif if (NeedsDetachReceivers) { *NeedsDetachReceivers = needsDetachReceivers; @@ -526,7 +524,7 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) is_scan = !strlen(Channel->Name()) && !strlen(Channel->Provider()); #ifdef DEBUG_TUNE - printf ("Mcli::%s: DVB:%d Channel(%p):%s, Provider:%s, Source:%d, LiveView:%s, IsScan:%d, m_chan.Name:%s\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Channel->Provider (), Channel->Source (), LiveView ? "true" : "false", is_scan, m_chan.Name()); + dsyslog ("Mcli::%s: DVB:%d Channel(%p):%s, Provider:%s, Source:%d, LiveView:%s, IsScan:%d, m_chan.Name:%s\n", __FUNCTION__, CardIndex () + 1, Channel, Channel->Name (), Channel->Provider (), Channel->Source (), LiveView ? "true" : "false", is_scan, m_chan.Name()); #endif if (!m_enable) { return false; @@ -543,7 +541,7 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) bool cam_force=true; if(cam_force && !CheckCAM(Channel, true)) { #ifdef DEBUG_TUNE - printf("Mcli::%s: No CAM on DVB %d available even after tried to steal one\n", __FUNCTION__, CardIndex () + 1); + dsyslog("Mcli::%s: No CAM on DVB %d available even after tried to steal one\n", __FUNCTION__, CardIndex () + 1); #endif return false; } @@ -558,7 +556,7 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) } if(!(m_camref=m_mcli->CAMAlloc(NULL, slot))) { #ifdef DEBUG_TUNE - printf("Mcli::%s: failed to get CAM on DVB %d\n", __FUNCTION__, CardIndex () + 1); + dsyslog("Mcli::%s: failed to get CAM on DVB %d\n", __FUNCTION__, CardIndex () + 1); #endif if(cam_force) { return false; @@ -619,7 +617,7 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) m_chan = *Channel; #ifdef DEBUG_TUNE - printf("Mcli::%s: Already tuned to transponder on DVB %d\n", __FUNCTION__, CardIndex () + 1); + dsyslog("Mcli::%s: Already tuned to transponder on DVB %d\n", __FUNCTION__, CardIndex () + 1); #endif return true; } else { @@ -753,9 +751,9 @@ bool cMcliDevice::SetChannelDevice (const cChannel * Channel, bool LiveView) // printf("add dummy pid 0 @ %p\n", this); } #ifdef DEBUG_PIDS - printf ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum); + dsyslog ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum); for (int i = 0; i < m_mcpidsnum; i++) { - printf ("Pid:%d\n", m_pids[i].pid); + dsyslog ("Pid:%d\n", m_pids[i].pid); } #endif m_ten.lastseen=m_last=time(NULL); @@ -783,7 +781,7 @@ bool cMcliDevice::HasLock (int TimeoutMs) const bool cMcliDevice::SetPid (cPidHandle * Handle, int Type, bool On) { #ifdef DEBUG_TUNE - printf ("Mcli::%s: DVB:%d Pid:%d (%s), Type:%d, On:%d, used:%d sid:%d ca_enable:%d channel_ca:%d\n", __FUNCTION__, CardIndex () + 1, Handle->pid, m_chan.Name(), Type, On, Handle->used, m_chan.Sid(), GetCaEnable(), m_chan.Ca (0)); + dsyslog ("Mcli::%s: DVB:%d Pid:%d (%s), Type:%d, On:%d, used:%d sid:%d ca_enable:%d channel_ca:%d\n", __FUNCTION__, CardIndex () + 1, Handle->pid, m_chan.Name(), Type, On, Handle->used, m_chan.Sid(), GetCaEnable(), m_chan.Ca (0)); #endif dvb_pid_t pi; memset (&pi, 0, sizeof (dvb_pid_t)); @@ -825,9 +823,9 @@ bool cMcliDevice::SetPid (cPidHandle * Handle, int Type, bool On) } m_mcpidsnum = recv_pids_get (m_r, m_pids); #ifdef DEBUG_PIDS - printf ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d m_filternum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum, m_filternum); + dsyslog ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d m_filternum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum, m_filternum); for (int i = 0; i < m_mcpidsnum; i++) { - printf ("Pid:%d\n", m_pids[i].pid); + dsyslog ("Pid:%d\n", m_pids[i].pid); } #endif m_last=time(NULL); @@ -836,14 +834,12 @@ bool cMcliDevice::SetPid (cPidHandle * Handle, int Type, bool On) bool cMcliDevice::OpenDvr (void) { - printf ("Mcli::%s:\n", __FUNCTION__); m_dvr_open = true; return true; } void cMcliDevice::CloseDvr (void) { - printf ("Mcli::%s:\n", __FUNCTION__); m_dvr_open = false; } @@ -920,9 +916,9 @@ int cMcliDevice::OpenFilter (u_short Pid, u_char Tid, u_char Mask) recv_pid_add (m_r, &pi); m_mcpidsnum = recv_pids_get (m_r, m_pids); #ifdef DEBUG_PIDS - printf ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum); + dsyslog ("Mcli::%s: %p Pidsnum:%d m_pidsnum:%d\n", __FUNCTION__, m_r, m_mcpidsnum, m_pidsnum); for (int i = 0; i < m_mcpidsnum; i++) { - printf ("Pid:%d\n", m_pids[i].pid); + dsyslog ("Pid:%d\n", m_pids[i].pid); } #endif return m_filters->OpenFilter (Pid, Tid, Mask); diff --git a/mcast/client/mmi_handler.c b/mcast/client/mmi_handler.c index 716c7f1..3787892 100644 --- a/mcast/client/mmi_handler.c +++ b/mcast/client/mmi_handler.c @@ -219,6 +219,8 @@ int mmi_get_data (xmlChar * xmlbuff, int buffersize, mmi_info_t * mmi_info) xmlKeepBlanksDefault (0); //reomve this f. "text" nodes c.doc = xmlParseMemory ((char *) xmlbuff, buffersize); + c.str = NULL; + c.key = NULL; root_element = xmlDocGetRootElement (c.doc); pthread_cleanup_push (clean_xml_parser_thread, &c); diff --git a/mcast/common/ciparser.c b/mcast/common/ciparser.c index 5ce563d..bacde43 100644 --- a/mcast/common/ciparser.c +++ b/mcast/common/ciparser.c @@ -23,10 +23,10 @@ static unsigned char lc[] = { 0x01, 0x02, 0xA0, 0x5F, 0x02, 0x90, 0x02, 0x00, 0x static unsigned char ld[] = { 0x00, 0x01, 0xA0, 0x82, 0x00, 0x10, 0x01, 0x90, 0x02, 0x00, 0x03, 0x9F, 0x80, 0x33, 0x07, 0x2D, 0xB9, 0x01, 0x81, 0x00, 0x08, 0x00, 0x80, 0x02, 0x01, 0x00 }; static unsigned char le[] = { 0x00, 0x01, 0xA0, 0x34, 0x01, 0x90, 0x02, 0x00, 0x03, 0x9F, 0x80, 0x32, 0x2B, 0x03, 0x00, 0x0B, 0x01, 0x00, 0x11, 0x01, 0x09, 0x06, 0x17, 0x22, 0xF0, 0x0B, 0x00, 0x0B, 0x09, 0x06, 0x17, 0x02, 0xF0, 0x0B, 0x00, 0x0B, 0x02, 0x06, 0xFF, 0x00, 0x00, 0x04, 0x07, 0x00, 0x00, 0x00, 0x04, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00}; -#define dbg(format, arg...) printf("%s:%d " format , __FILE__ , __LINE__ , ## arg) -#define err(format, arg...) {printf("err:%s:%d: %s (%d): " format , __FILE__ , __LINE__ ,strerror(errno), errno, ## arg);print_trace();abort();} -#define info(format, arg...) printf("%s:%d: " format , __FILE__ , __LINE__ ,## arg) -#define warn(format, arg...) printf("%s:%d: " format , __FILE__ , __LINE__ ,## arg) +#define dbg(format, arg...) dsyslog("%s:%d " format , __FILE__ , __LINE__ , ## arg) +#define err(format, arg...) {esyslog("err:%s:%d: %s (%d): " format , __FILE__ , __LINE__ ,strerror(errno), errno, ## arg);print_trace();abort();} +#define info(format, arg...) isyslog("%s:%d: " format , __FILE__ , __LINE__ ,## arg) +#define warn(format, arg...) isyslog("%s:%d: " format , __FILE__ , __LINE__ ,## arg) #define STATIC #else //#define DEBUG diff --git a/mcast/common/mld_client.c b/mcast/common/mld_client.c index d291466..7369174 100644 --- a/mcast/common/mld_client.c +++ b/mcast/common/mld_client.c @@ -31,9 +31,6 @@ int send_mldv2_report (struct intnode *intn, int grec_number, struct in6_addr *m int mca_index, src_index; int count = 0; - bool any = false; - - //printf("creating multicast listener report packet....\n"); //printf("size src = %d size grec = %d \n",sizeof(*src),sizeof(*grec)); if (intn->mtu < sizeof (*packet)) { @@ -156,8 +153,6 @@ int send_mldv2_report (struct intnode *intn, int grec_number, struct in6_addr *m } /* Nothing added yet */ - any = false; - for (src_index = 0; src_index < srcn || (!srcn && src_index == 0); src_index++) { //check for duplicate source reocrds and any address diff --git a/mcast/common/recv_ccpp.c b/mcast/common/recv_ccpp.c index ce15e4c..bc02917 100644 --- a/mcast/common/recv_ccpp.c +++ b/mcast/common/recv_ccpp.c @@ -469,8 +469,8 @@ void *recv_ten (void *arg) clock_t lastrecv=0; int donetimeout=0; - pthread_cleanup_push (clean_ccpp_thread, &c); memset (&c, 0, sizeof (ccpp_thread_context_t)); + pthread_cleanup_push (clean_ccpp_thread, &c); c.buf=(xmlChar *)malloc(XML_BUFLEN); if (!c.buf) { @@ -599,8 +599,8 @@ void *recv_tra (void *arg) unsigned int dstlen; struct in6_addr tra; - pthread_cleanup_push (clean_ccpp_thread, &c); memset (&c, 0, sizeof (ccpp_thread_context_t)); + pthread_cleanup_push (clean_ccpp_thread, &c); c.buf=(xmlChar *)malloc(XML_BUFLEN); if (!c.buf) { @@ -1278,6 +1278,7 @@ void *recv_tca (void *arg) netceiver_info_t nc_info; struct in6_addr tca; + memset (&c, 0, sizeof (ccpp_thread_context_t)); pthread_cleanup_push (clean_ccpp_thread, &c); c.buf=(xmlChar *)malloc(XML_BUFLEN); @@ -60,7 +60,7 @@ cOsdObject *cPluginMcli::AltMenuAction (void) // The text received should pop up via OSD with a CAM-Session opened afterwards (CamMenuOpen...CamMenuReceive...CamMenuSend...CamMenuClose). mmi_info_t m; if (CamPollText (&m) > 0) { - printf ("NetCeiver %s CAM slot %d Received %s valid for:\n", m.uuid, m.slot, m.mmi_text); + isyslog ("NetCeiver %s CAM slot %d Received %s valid for:\n", m.uuid, m.slot, m.mmi_text); for (int i = 0; i < m.caid_num; i++) { caid_mcg_t *c = m.caids + i; int satpos; @@ -74,22 +74,22 @@ cOsdObject *cPluginMcli::AltMenuAction (void) for (cMcliDeviceObject * dev = m_devs.First (); dev; dev = m_devs.Next (dev)) { cMcliDevice *d = dev->d (); - //printf("satpos: %i vpid: %i fep.freq: %i dev.freq: %i\n", satpos, vpid, fep.frequency, dev->CurChan()->Frequency()); + dsyslog("satpos: %i vpid: %i fep.freq: %i\n", satpos, vpid, fep.frequency); struct in6_addr mcg = d->GetTenData ()->mcg; mcg_set_id (&mcg, 0); #if 1 //def DEBUG char str[INET6_ADDRSTRLEN]; inet_ntop (AF_INET6, &c->mcg, str, INET6_ADDRSTRLEN); - printf ("MCG from MMI: %s\n", str); + dsyslog ("MCG from MMI: %s\n", str); inet_ntop (AF_INET6, &mcg, str, INET6_ADDRSTRLEN); - printf ("MCG from DEV: %s\n", str); + dsyslog ("MCG from DEV: %s\n", str); #endif if (IN6_IS_ADDR_UNSPECIFIED (&c->mcg) || !memcmp (&c->mcg, &mcg, sizeof (struct in6_addr))) return new cCamMenu (&m_cmd, &m); } - printf ("SID/Program Number:%04x, SatPos:%d Freqency:%d\n", c->caid, satpos, fep.frequency); + isyslog ("SID/Program Number:%04x, SatPos:%d Freqency:%d\n", c->caid, satpos, fep.frequency); } if (m.caid_num && m.caids) { free (m.caids); @@ -109,7 +109,6 @@ int cPluginMcli::CamPollText (mmi_info_t * text) cPluginMcli::cPluginMcli (void) { - // printf ("cPluginMcli::cPluginMcli\n"); int i; //init parameters memset (&m_cmd, 0, sizeof (cmdline_t)); @@ -136,7 +135,6 @@ cPluginMcli::cPluginMcli (void) cPluginMcli::~cPluginMcli () { -// printf ("cPluginMcli::~cPluginMcli\n"); ExitMcli (); } @@ -226,7 +224,6 @@ const char *cPluginMcli::CommandLineHelp (void) bool cPluginMcli::ProcessArgs (int argc, char *argv[]) { -// printf ("cPluginMcli::ProcessArgs\n"); int tuners = 0, i; char c; int ret; @@ -278,7 +275,7 @@ bool cPluginMcli::ProcessArgs (int argc, char *argv[]) strncpy (m_cmd.cmd_sock_path, optarg, _POSIX_PATH_MAX - 1); break; default: - printf ("?? getopt returned character code 0%o ??\n", c); + dsyslog ("?? getopt returned character code 0%o ??\n", c); } } // Implement command line argument processing here if applicable. @@ -380,7 +377,7 @@ cam_pool_t *cPluginMcli::CAMAvailable (const char *uuid, int slot, bool lock) } #ifdef DEBUG_RESOURCES if(ret) { - printf("Mcli::%s: Available CAM [%s]:%d -> [%s]:%d\n", __FUNCTION__, uuid, slot, ret->uuid, ret->slot); + dsyslog("Mcli::%s: Available CAM [%s]:%d -> [%s]:%d\n", __FUNCTION__, uuid, slot, ret->uuid, ret->slot); } #endif if(lock) { @@ -399,9 +396,9 @@ cam_pool_t *cPluginMcli::CAMAlloc (const char *uuid, int slot) #ifdef DEBUG_RESOURCES if(cp) { - printf ("Mcli::%s: AllocateCAM [%s]:%d -> [%s]:%d\n", __FUNCTION__, uuid, slot, cp->uuid, cp->slot); + dsyslog ("Mcli::%s: AllocateCAM [%s]:%d -> [%s]:%d\n", __FUNCTION__, uuid, slot, cp->uuid, cp->slot); } else { - printf ("Mcli::%s: AllocateCAM [%s]:%d -> FAIL\n", __FUNCTION__, uuid, slot); + dsyslog ("Mcli::%s: AllocateCAM [%s]:%d -> FAIL\n", __FUNCTION__, uuid, slot); } #endif @@ -412,7 +409,7 @@ int cPluginMcli::CAMFree (cam_pool_t *cp) { LOCK_THREAD; #ifdef DEBUG_RESOURCES - printf ("Mcli::%s: FreeCAM [%s]:%d\n", __FUNCTION__, cp->uuid, cp->slot); + dsyslog ("Mcli::%s: FreeCAM [%s]:%d\n", __FUNCTION__, cp->uuid, cp->slot); #endif if (cp->use > 0) { cp->use--; @@ -426,12 +423,12 @@ bool cPluginMcli::CAMSteal(const char *uuid, int slot, bool force) cam_pool_t *cp=d->d()->GetCAMref(); if(d->d()->Priority()<0 && d->d()->GetCaEnable() && (slot == -1 || slot == cp->slot)) { #ifdef DEBUG_RESOURCES - printf("Mcli::%s: Can Steal CAM on slot %d from DVB %d\n", __FUNCTION__, slot, d->d()->CardIndex()+1); + dsyslog("Mcli::%s: Can Steal CAM on slot %d from DVB %d\n", __FUNCTION__, slot, d->d()->CardIndex()+1); #endif if(force) { d->d ()->SetTempDisable (true); #ifdef DEBUG_RESOURCES - printf("Mcli::%s: Stole CAM on slot %d from DVB %d\n", __FUNCTION__, cp->slot, d->d()->CardIndex()+1); + dsyslog("Mcli::%s: Stole CAM on slot %d from DVB %d\n", __FUNCTION__, cp->slot, d->d()->CardIndex()+1); #endif } return true; @@ -516,12 +513,12 @@ bool cPluginMcli::TunerSatelitePositionLookup(tuner_pool_t *tp, int pos) const } bool ret; if(satlist == NULL) { - printf("Mcli::%s: No Satlist found \n", __FUNCTION__); + esyslog("Mcli::%s: No Satlist found \n", __FUNCTION__); ret = false; } else { ret=SatelitePositionLookup(satlist, pos); if (!ret) { - printf("Mcli::%s: Pos %d not found in Satlist \n", __FUNCTION__, pos); + esyslog("Mcli::%s: Pos %d not found in Satlist \n", __FUNCTION__, pos); } } nc_unlock_list (); @@ -608,12 +605,12 @@ tuner_pool_t *cPluginMcli::TunerAvailable(fe_type_t type, int pos, bool lock) Lock(); } - printf("Mcli::%s: Testing for tuner type %d pos %d\n", __FUNCTION__, type, pos); + isyslog("Mcli::%s: Testing for tuner type %d pos %d\n", __FUNCTION__, type, pos); if (TunerCountByType (type) == m_cmd.tuner_type_limit[type]) { #ifdef DEBUG_RESOURCES - printf("Mcli::%s: type %d limit (%d) reached\n", __FUNCTION__, type, m_cmd.tuner_type_limit[type]); + dsyslog("Mcli::%s: type %d limit (%d) reached\n", __FUNCTION__, type, m_cmd.tuner_type_limit[type]); #endif if(lock) { Unlock(); @@ -632,13 +629,13 @@ tuner_pool_t *cPluginMcli::TunerAvailable(fe_type_t type, int pos, bool lock) continue; } #ifdef DEBUG_RESOURCES - printf("Mcli::%s: Tuner %d(%p), type %d, inuse %d\n", __FUNCTION__, i, tp, tp->type, tp->inuse); + dsyslog("Mcli::%s: Tuner %d(%p), type %d, inuse %d\n", __FUNCTION__, i, tp, tp->type, tp->inuse); #endif if(TunerSatelitePositionLookup(tp, pos)) { if(lock) { Unlock(); } - printf("Mcli::%s: Tuner %d(%p) available\n", __FUNCTION__, i, tp); + isyslog("Mcli::%s: Tuner %d(%p) available\n", __FUNCTION__, i, tp); return tp; } @@ -647,7 +644,7 @@ tuner_pool_t *cPluginMcli::TunerAvailable(fe_type_t type, int pos, bool lock) Unlock(); } - printf("Mcli::%s: No tuner available\n", __FUNCTION__); + esyslog("Mcli::%s: No tuner available\n", __FUNCTION__); return NULL; } @@ -662,7 +659,7 @@ tuner_pool_t *cPluginMcli::TunerAlloc(fe_type_t type, int pos, bool lock) if(tp) { tp->inuse=true; #ifdef DEBUG_RESOURCES - printf("Mcli::%s: %p [%s], Type %d\n", __FUNCTION__, tp, tp->uuid, tp->type); + dsyslog("Mcli::%s: %p [%s], Type %d\n", __FUNCTION__, tp, tp->uuid, tp->type); #endif if(lock) { Unlock(); @@ -682,7 +679,7 @@ bool cPluginMcli::TunerFree(tuner_pool_t *tp, bool lock) if(tp->inuse) { tp->inuse=false; #ifdef DEBUG_RESOURCES - printf("Mcli::%s: %p [%s], Type %d\n", __FUNCTION__, tp, tp->uuid, tp->type); + dsyslog("Mcli::%s: %p [%s], Type %d\n", __FUNCTION__, tp, tp->uuid, tp->type); #endif if(lock) { Unlock(); @@ -731,13 +728,13 @@ void cPluginMcli::Action (void) if ((now - nci->lastseen) > MCLI_DEVICE_TIMEOUT) { if(CAMPoolDel(nci->uuid)) { - printf ("Mcli::%s: Remove CAMs from NetCeiver: [%s]\n", __FUNCTION__, nci->uuid); + isyslog ("Mcli::%s: Remove CAMs from NetCeiver: [%s]\n", __FUNCTION__, nci->uuid); netCVChanged = true; } } else { int cpa = CAMPoolAdd(nci); if(cpa==1) { - printf ("Mcli::%s: Add CAMs from NetCeiver: [%s] -> %d\n", __FUNCTION__, nci->uuid, cpa); + isyslog ("Mcli::%s: Add CAMs from NetCeiver: [%s] -> %d\n", __FUNCTION__, nci->uuid, cpa); netCVChanged = true; } } @@ -745,8 +742,8 @@ void cPluginMcli::Action (void) if (netCVChanged) { for(int j = 0; j < nci->cam_num; j++) { - const char *camstate; - const char *cammode; + const char *camstate = ""; + const char *cammode = ""; switch(nci->cam[j].status) { case DVBCA_CAMSTATE_MISSING: @@ -766,9 +763,9 @@ void cPluginMcli::Action (void) } if (nci->cam[j].status != DVBCA_CAMSTATE_MISSING) { - printf("Mcli::%s: Slot:%d CamModule '%s' State:%s Mode:%s\n", __FUNCTION__, j, nci->cam[j].menu_string, camstate, cammode); + isyslog("Mcli::%s: Slot:%d CamModule '%s' State:%s Mode:%s\n", __FUNCTION__, j, nci->cam[j].menu_string, camstate, cammode); } else { - printf("Mcli::%s: Slot:%d CamModule State:%s\n", __FUNCTION__, j, camstate); + isyslog("Mcli::%s: Slot:%d CamModule State:%s\n", __FUNCTION__, j, camstate); } } } @@ -806,7 +803,7 @@ void cPluginMcli::Action (void) if (((now - nci->lastseen) > MCLI_DEVICE_TIMEOUT) || (nci->tuner[i].preference < 0) || !strlen (nci->tuner[i].uuid)) { if (t) { int pos=TunerPoolDel(t); - printf ("Mcli::%s: Remove Tuner %s [%s] @ %d\n", __FUNCTION__, nci->tuner[i].fe_info.name, nci->tuner[i].uuid, pos); + isyslog ("Mcli::%s: Remove Tuner %s [%s] @ %d\n", __FUNCTION__, nci->tuner[i].fe_info.name, nci->tuner[i].uuid, pos); //isyslog ("cPluginMcli::Action: Remove Tuner %s [%s] @ %d", nci->tuner[i].fe_info.name, nci->tuner[i].uuid, pos); netCVChanged = true; } @@ -814,7 +811,7 @@ void cPluginMcli::Action (void) } if (!t) { tpa=TunerPoolAdd(nci->tuner+i); - printf ("Mcli::%s: Add Tuner: %s [%s], Type %d @ %d\n", __FUNCTION__, nci->tuner[i].fe_info.name, nci->tuner[i].uuid, nci->tuner[i].fe_info.type, tpa); + isyslog ("Mcli::%s: Add Tuner: %s [%s], Type %d @ %d\n", __FUNCTION__, nci->tuner[i].fe_info.name, nci->tuner[i].uuid, nci->tuner[i].fe_info.type, tpa); //isyslog ("cPluginMcli::Action: Add Tuner: %s [%s], Type %d @ %d", nci->tuner[i].fe_info.name, nci->tuner[i].uuid, nci->tuner[i].fe_info.type, tpa); netCVChanged = true; } @@ -835,7 +832,7 @@ void cPluginMcli::Action (void) if (!channel_switch_ok) { // the first tuner that was found, so make VDR retune to the channel it wants... cChannel *ch = Channels.GetByNumber (cDevice::CurrentChannel ()); if (ch) { - printf("Mcli::%s: cDevice::PrimaryDevice (%p)\n", __FUNCTION__, cDevice::PrimaryDevice ()); + dsyslog("Mcli::%s: cDevice::PrimaryDevice (%p)\n", __FUNCTION__, cDevice::PrimaryDevice ()); channel_switch_ok = cDevice::PrimaryDevice ()->SwitchChannel (ch, true); } } @@ -866,7 +863,6 @@ bool cPluginMcli::Initialize (void) bool cPluginMcli::Start (void) { - printf ("Mcli::%s:\n", __FUNCTION__); isyslog("Mcli v"MCLI_PLUGIN_VERSION" started"); #ifdef REELVDR if (access("/dev/dvb/adapter0", F_OK) != 0) //TB: this line allows the client to be used with usb-sticks without conflicts @@ -878,7 +874,6 @@ bool cPluginMcli::Start (void) void cPluginMcli::Stop (void) { - printf ("Mcli::%s:\n", __FUNCTION__); cThread::Cancel (0); for (cMcliDeviceObject * d = m_devs.First (); d; d = m_devs.Next (d)) { d->d ()->SetEnable (false); @@ -888,12 +883,10 @@ void cPluginMcli::Stop (void) void cPluginMcli::Housekeeping (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); } void cPluginMcli::MainThreadHook (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); if (reconf) { reconfigure (); reconf = 0; @@ -911,14 +904,12 @@ void cPluginMcli::MainThreadHook (void) cString cPluginMcli::Active (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); // Return a message string if shutdown should be postponed return NULL; } time_t cPluginMcli::WakeupTime (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); // Return custom wakeup time for shutdown script return 0; } @@ -969,7 +960,6 @@ void cPluginMcli::UpdateDevices() { cOsdObject *cPluginMcli::MainMenuAction (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); // Perform the action when selected from the main VDR menu. return new cCamMenu (&m_cmd); } @@ -977,14 +967,12 @@ cOsdObject *cPluginMcli::MainMenuAction (void) cMenuSetupPage *cPluginMcli::SetupMenu (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); // Return a setup menu in case the plugin supports one. return new cMenuSetupMcli (&m_cmd); } bool cPluginMcli::SetupParse (const char *Name, const char *Value) { -// printf ("Mcli::%s:\n", __FUNCTION__); if (!strcasecmp (Name, "DVB-C") && m_cmd.tuner_type_limit[FE_QAM] == MCLI_MAX_DEVICES) m_cmd.tuner_type_limit[FE_QAM] = atoi (Value); else if (!strcasecmp (Name, "DVB-T") && m_cmd.tuner_type_limit[FE_OFDM] == MCLI_MAX_DEVICES) @@ -1000,8 +988,6 @@ bool cPluginMcli::SetupParse (const char *Name, const char *Value) bool cPluginMcli::Service (const char *Id, void *Data) { - //printf ("Mcli::%s: \"%s\"\n", __FUNCTION__, Id); - mclituner_info_t *infos = (mclituner_info_t *) Data; if (Id && strcmp (Id, "GetTunerInfo") == 0) { @@ -1018,7 +1004,7 @@ bool cPluginMcli::Service (const char *Id, void *Data) strcpy (infos->name[j], nci->tuner[i].fe_info.name); infos->type[j] = nci->tuner[i].fe_info.type; infos->preference[j++] = nci->tuner[i].preference; - printf("Mcli::%s: Tuner: %s\n", __FUNCTION__, nci->tuner[i].fe_info.name); + dsyslog("Mcli::%s: Tuner: %s\n", __FUNCTION__, nci->tuner[i].fe_info.name); } } nc_unlock_list (); @@ -1081,7 +1067,6 @@ bool cPluginMcli::Service (const char *Id, void *Data) const char **cPluginMcli::SVDRPHelpPages (void) { -// printf ("Mcli::%s:\n", __FUNCTION__); // Return help text for SVDRP commands this plugin implements static const char *HelpPages[] = { "GETTC\n" " List available tuners.", @@ -1093,8 +1078,6 @@ const char **cPluginMcli::SVDRPHelpPages (void) cString cPluginMcli::SVDRPCommand (const char *Command, const char *Option, int &ReplyCode) { -// printf ("Mcli::%s:\n", __FUNCTION__); - typedef struct nrTuners { int sat; @@ -65,7 +65,7 @@ class cMcliDeviceList:public cList < cMcliDeviceObject > { }; ~cMcliDeviceList () { - printf ("Delete my Dev list\n"); + dsyslog ("Delete my Dev list\n"); }; }; |