How to get a notification of a completed transponder scan?

Message ID 424AE5D7.5030100@ventoso.org
State New
Headers

Commit Message

Luca Olivetti March 30, 2005, 5:45 p.m. UTC
  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
  

Comments

Thomas Bergwinkl March 30, 2005, 7:31 p.m. UTC | #1
Luca Olivetti wrote:

>
> 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
>

Sorry, was this a question (why filter.[hc] doesn't care for
Setup.UpdateChannels) or just a info (that you do no longer care for
Setup.UpdateChannels in your plugin)?

Thomas
  
Luca Olivetti March 30, 2005, 9:08 p.m. UTC | #2
Thomas Bergwinkl wrote:
> Luca Olivetti wrote:
[...]
>>
>>Added statistics and doesn't care for Setup.UpdateChannels
>>
> 
> 
> Sorry, was this a question (why filter.[hc] doesn't care for
> Setup.UpdateChannels) or just a info (that you do no longer care for
> Setup.UpdateChannels in your plugin)?

the latter.

Bye
  

Patch

--- 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