Klaus Schmidinger wrote:
> Anssi Hannula wrote:
>> NIT handling was changed in 1.4.3-4 by adding an additional check if
>> we're actually receiving this transponder. See the current code:
>>
>>>                  for (cChannel *Channel = Channels.First(); Channel; 
>>> Channel = Channels.Next(Channel)) {
>>>                      if (!Channel->GroupSep() && Channel->Source() == 
>>> Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == 
>>> ts.getTransportStreamId()) {
>>>                         if (Setup.UpdateChannels >= 5) {
>>>                            if (ISTRANSPONDER(Frequency / 1000, 
>>> Transponder())) { // only modify channels if we're actually receiving this 
>>> transponder
>> The above check was added. However, the variable 'Frequency' may not
>> always be the current transponder frequency. The current transponder
>> could also be in the Frequencies[] array. This causes the channel update
>> to be always disabled.
>>
>> Below we search the array if the transponder of the 'Channel' is there:
>>
>>>                               if (!ISTRANSPONDER(Frequency / 1000, 
>>> Channel->Transponder())) {
>>>                                  for (int n = 0; n < NumFrequencies; n++) {
>>>                                      if (ISTRANSPONDER(Frequencies[n] / 
>>> 1000, Channel->Transponder())) {
>>>                                         Frequency = Frequencies[n];
>>>                                         break;
>>>                                         }
>>>                                      }
>>>                                  }
>> Maybe the new check should be moved here, so that it uses the new
>> correct 'Frequency' that was found from Frequencies[] in the loop above?
>>
>>>                               Channel->SetCableTransponderData(Source, 
>>> Frequency, Modulation, SymbolRate, CodeRate);
>>>                               }
>>>                            }
>>>                         found = true;
>>>                         }
>>>                      }
> 
> Can you please provide a (tested) patch?

Attached.

I tested by messing up transponder parameters of one channel. Without
the patch, the channel was not fixed by VDR. With the patch, the
transponder data was correctly updated back to the correct one.

-- 
Anssi Hannula

diff -Nurp -x '*~' vdr-1.4.6/nit.c vdr-1.4.6-f/nit.c
--- vdr-1.4.6/nit.c	2006-10-28 15:31:04.000000000 +0300
+++ vdr-1.4.6-f/nit.c	2007-04-21 05:12:48.000000000 +0300
@@ -144,17 +144,16 @@ void cNitFilter::Process(u_short Pid, u_
                  for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
                      if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
                         if (Setup.UpdateChannels >= 5) {
-                           if (ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Transponder())) { // only modify channels if we're actually receiving this transponder
-                              if (!ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Channel->Transponder())) {
-                                 for (int n = 0; n < NumFrequencies; n++) {
-                                     if (ISTRANSPONDER(cChannel::Transponder(Frequencies[n], Polarization), Channel->Transponder())) {
-                                        Frequency = Frequencies[n];
-                                        break;
-                                        }
+                           if (!ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Channel->Transponder())) {
+                              for (int n = 0; n < NumFrequencies; n++) {
+                                  if (ISTRANSPONDER(cChannel::Transponder(Frequencies[n], Polarization), Channel->Transponder())) {
+                                     Frequency = Frequencies[n];
+                                     break;
                                      }
-                                 }
-                              Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate);
+                                  }
                               }
+                           if (ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Transponder())) // only modify channels if we're actually receiving this transponder
+                              Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate);
                            }
                         found = true;
                         }
@@ -195,17 +194,16 @@ void cNitFilter::Process(u_short Pid, u_
                  for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
                      if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
                         if (Setup.UpdateChannels >= 5) {
-                           if (ISTRANSPONDER(Frequency / 1000, Transponder())) { // only modify channels if we're actually receiving this transponder
-                              if (!ISTRANSPONDER(Frequency / 1000, Channel->Transponder())) {
-                                 for (int n = 0; n < NumFrequencies; n++) {
-                                     if (ISTRANSPONDER(Frequencies[n] / 1000, Channel->Transponder())) {
-                                        Frequency = Frequencies[n];
-                                        break;
-                                        }
+                           if (!ISTRANSPONDER(Frequency / 1000, Channel->Transponder())) {
+                              for (int n = 0; n < NumFrequencies; n++) {
+                                  if (ISTRANSPONDER(Frequencies[n] / 1000, Channel->Transponder())) {
+                                     Frequency = Frequencies[n];
+                                     break;
                                      }
-                                 }
-                              Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate);
+                                  }
                               }
+                           if (ISTRANSPONDER(Frequency / 1000, Transponder())) // only modify channels if we're actually receiving this transponder
+                              Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate);
                            }
                         found = true;
                         }
@@ -253,17 +251,16 @@ void cNitFilter::Process(u_short Pid, u_
                  for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
                      if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
                         if (Setup.UpdateChannels >= 5) {
-                           if (ISTRANSPONDER(Frequency / 1000000, Transponder())) { // only modify channels if we're actually receiving this transponder
-                              if (!ISTRANSPONDER(Frequency / 1000000, Channel->Transponder())) {
-                                 for (int n = 0; n < NumFrequencies; n++) {
-                                     if (ISTRANSPONDER(Frequencies[n] / 1000000, Channel->Transponder())) {
-                                        Frequency = Frequencies[n];
-                                        break;
-                                        }
+                           if (!ISTRANSPONDER(Frequency / 1000000, Channel->Transponder())) {
+                              for (int n = 0; n < NumFrequencies; n++) {
+                                  if (ISTRANSPONDER(Frequencies[n] / 1000000, Channel->Transponder())) {
+                                     Frequency = Frequencies[n];
+                                     break;
                                      }
-                                 }
-                              Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode);
+                                  }
                               }
+                           if (ISTRANSPONDER(Frequency / 1000000, Transponder())) // only modify channels if we're actually receiving this transponder
+                              Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode);
                            }
                         found = true;
                         }
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to