[vdr] Premiere NVOD Channels fix

vdr at minivdr.de vdr at minivdr.de
Wed Jul 4 21:44:09 CEST 2007


Hello @all,

Fix Premiere NVOD Channels.

Link for new Channels over TransponderID added.

-------------- next part --------------
diff -Nru vdr-1.4.7-org/channels.c vdr-1.4.7/channels.c
--- vdr-1.4.7-org/channels.c	2006-05-28 17:03:40.000000000 +0200
+++ vdr-1.4.7/channels.c	2007-07-04 21:28:36.000000000 +0200
@@ -1007,6 +1007,18 @@
      }
   return NULL;
 }
+cChannel *cChannels::GetByTransponderID(tChannelID ChannelID)
+{
+  int source = ChannelID.Source();
+  int nid = ChannelID.Nid(); // networkd
+  int tid = ChannelID.Tid(); // transponderId 
+ 
+     for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
+        if (channel->Tid() == tid &&  channel->Nid() == nid && channel->Source() == source)
+           return channel;
+        }
+    return NULL;
+}
 
 bool cChannels::HasUniqueChannelID(cChannel *NewChannel, cChannel *OldChannel)
 {
diff -Nru vdr-1.4.7-org/channels.h vdr-1.4.7/channels.h
--- vdr-1.4.7-org/channels.h	2006-05-28 17:03:56.000000000 +0200
+++ vdr-1.4.7/channels.h	2007-07-04 21:29:24.000000000 +0200
@@ -238,6 +238,7 @@
   cChannel *GetByNumber(int Number, int SkipGap = 0);
   cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID);
   cChannel *GetByChannelID(tChannelID ChannelID, bool TryWithoutRid = false, bool TryWithoutPolarization = false);
+  cChannel *cChannels::GetByTransponderID(tChannelID ChannelID);
   int BeingEdited(void) { return beingEdited; }
   void IncBeingEdited(void) { beingEdited++; }
   void DecBeingEdited(void) { beingEdited--; }
diff -Nru vdr-1.4.7-org/eit.c vdr-1.4.7/eit.c
--- vdr-1.4.7-org/eit.c	2006-10-09 18:14:36.000000000 +0200
+++ vdr-1.4.7/eit.c	2007-07-04 21:27:20.000000000 +0200
@@ -196,7 +196,12 @@
                                 link->SetName(linkName, "", "");
                              }
                           else if (Setup.UpdateChannels >= 4) {
-                             link = Channels.NewChannel(channel, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
+                              if (channel->Tid() != ld->getTransportStreamId()) {
+                                 cChannel *transponder = Channels.GetByTransponderID(linkID);
+                                  link = Channels.NewChannel(transponder, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
+                                 }
+                              else 
+                                 link = Channels.NewChannel(channel, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
                              //XXX patFilter->Trigger();
                              }
                           if (link) {


More information about the vdr mailing list