From patchwork Wed Mar 30 17:45:59 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Olivetti X-Patchwork-Id: 11837 Received: from 232.red-213-97-27.pooles.rima-tde.net ([213.97.27.232]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DGhGp-00017Y-0Y for vdr@linuxtv.org; Wed, 30 Mar 2005 19:46:23 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by 232.Red-213-97-27.pooles.rima-tde.net (Postfix) with ESMTP id 7045A18A85E7 for ; Wed, 30 Mar 2005 19:46:06 +0200 (CEST) Message-ID: <424AE5D7.5030100@ventoso.org> Date: Wed, 30 Mar 2005 19:45:59 +0200 From: Luca Olivetti User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: Re: [vdr] How to get a notification of a completed transponder scan? References: In-Reply-To: X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2005 17:46:23 -0000 Status: O X-Status: X-Keywords: X-UID: 1267 Thomas Bergwinkl wrote: > I think, I found my mistake. > There was also a problem with scanning transponders without tv/radio > channels. The attached patch for filter.[hc] should solve these > problems. Added statistics and doesn't care for Setup.UpdateChannels Bye --- filter.c.orig 2005-03-30 19:41:21.883677507 +0200 +++ filter.c 2005-03-30 19:41:34.370859928 +0200 @@ -458,6 +458,9 @@ // --- cSdtFilter ------------------------------------------------------------ +int SdtFilter::channelsFound = 0; +int SdtFilter::newFound = 0; + SdtFilter::SdtFilter(PatFilter *PatFilter) { patFilter = PatFilter; @@ -509,9 +512,9 @@ char *pp = compactspace(ProviderNameBuf); sid[numSid++]=SiSdtService.getServiceId(); if (channel) { + channelsFound++; channel->SetId(sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId(),channel->Rid()); - if (Setup.UpdateChannels >= 1) - channel->SetName(pn, ps, pp); + channel->SetName(pn, ps, pp); // Using SiSdtService.getFreeCaMode() is no good, because some // tv stations set this flag even for non-encrypted channels :-( // The special value 0xFFFF was supposed to mean "unknown encryption" @@ -519,6 +522,8 @@ // channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0); } else if (*pn) { + channelsFound++; + newFound++; channel = Channels.NewChannel(Channel(), pn, ps, pp, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()); patFilter->Trigger(); } @@ -527,12 +532,14 @@ } break; case SI::NVODReferenceDescriptorTag: { + channelsFound++; SI::NVODReferenceDescriptor *nrd = (SI::NVODReferenceDescriptor *)d; SI::NVODReferenceDescriptor::Service Service; for (SI::Loop::Iterator it; nrd->serviceLoop.getNext(Service, it); ) { cChannel *link = Channels.GetByChannelID(tChannelID(Source(), Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId())); sid[numSid++]=SiSdtService.getServiceId(); if (!link) { + newFound++; link = Channels.NewChannel(Channel(), "NVOD", "", "", Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId()); patFilter->Trigger(); } @@ -561,3 +568,19 @@ SetStatus(false); } } + +void SdtFilter::ResetFound(void) +{ + channelsFound=0; + newFound=0; +} + +int SdtFilter::ChannelsFound(void) +{ + return channelsFound; +} + +int SdtFilter::NewFound(void) +{ + return newFound; +} --- filter.h.orig 2005-03-30 18:21:02.029343890 +0200 +++ filter.h 2005-03-30 19:19:27.668324073 +0200 @@ -41,6 +41,8 @@ class SdtFilter : public cFilter { friend class PatFilter; private: + static int channelsFound; + static int newFound; int numSid,sid[100]; cSectionSyncer sectionSyncer; PatFilter *patFilter; @@ -49,6 +51,9 @@ public: SdtFilter(PatFilter *PatFilter); virtual void SetStatus(bool On); + static void ResetFound(void); + static int ChannelsFound(void); + static int NewFound(void); }; #endif