Premiere NVOD Channels fix

Message ID 46A22069.5090702@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger July 21, 2007, 3:04 p.m. UTC
  On 07/04/07 21:44, vdr@minivdr.de wrote:
> Hello @all,
> 
> Fix Premiere NVOD Channels.
> 
> Link for new Channels over TransponderID added.

Please verify whether the attached, slightly modified
version also works. The diff is against VDR 1.5.5, but it
should also work with version 1.4.7.

Also, please provide a real name for the VDR/CONTRIBUTORS file.

Klaus
  

Patch

--- channels.c	2006/05/28 15:03:40	1.53
+++ channels.c	2007/07/21 14:55:01
@@ -1007,6 +1007,17 @@ 
      }
   return NULL;
 }
+cChannel *cChannels::GetByTransponderID(tChannelID ChannelID)
+{
+  int source = ChannelID.Source();
+  int nid = ChannelID.Nid();
+  int tid = ChannelID.Tid();
+  for (cChannel *channel = First(); channel; channel = Next(channel)) {
+      if (channel->Tid() == tid && channel->Nid() == nid && channel->Source() == source)
+         return channel;
+      }
+  return NULL;
+}
 
 bool cChannels::HasUniqueChannelID(cChannel *NewChannel, cChannel *OldChannel)
 {
--- channels.h	2007/01/05 10:37:35	1.43
+++ channels.h	2007/07/21 14:58:36
@@ -239,6 +239,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 *GetByTransponderID(tChannelID ChannelID);
   int BeingEdited(void) { return beingEdited; }
   void IncBeingEdited(void) { beingEdited++; }
   void DecBeingEdited(void) { beingEdited--; }
--- eit.c	2007/06/10 12:51:05	1.123
+++ eit.c	2007/07/21 14:58:04
@@ -197,7 +197,10 @@ 
                                 link->SetName(linkName, "", "");
                              }
                           else if (Setup.UpdateChannels >= 4) {
-                             link = Channels.NewChannel(channel, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
+                             cChannel *transponder = channel;
+                             if (channel->Tid() != ld->getTransportStreamId())
+                                channel = Channels.GetByTransponderID(linkID);
+                             link = Channels.NewChannel(transponder, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
                              //XXX patFilter->Trigger();
                              }
                           if (link) {