From patchwork Sat Apr 21 02:30:52 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anssi Hannula X-Patchwork-Id: 12451 Received: from pne-smtpout3-sn2.hy.skanova.net ([81.228.8.111]) by www.linuxtv.org with esmtp (Exim 4.50) id 1Hf5Nl-0006Rf-Rk for vdr@linuxtv.org; Sat, 21 Apr 2007 04:31:25 +0200 Received: from mail.onse.fi (80.223.77.223) by pne-smtpout3-sn2.hy.skanova.net (7.2.075) id 46153C27000C80DC for vdr@linuxtv.org; Sat, 21 Apr 2007 04:30:54 +0200 Received: from kone.onse.fi (kone [10.0.0.3]) by mail.onse.fi (Postfix) with ESMTP id AD22D30FC002 for ; Sat, 21 Apr 2007 05:30:53 +0300 (EEST) Message-ID: <4629775C.30801@gmail.com> Date: Sat, 21 Apr 2007 05:30:52 +0300 From: Anssi Hannula User-Agent: Thunderbird 2.0b2 (X11/20070308) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] NIT handling change in 1.4.3-4 References: <4594052A.1010601@gmail.com> <459D093E.80600@cadsoft.de> In-Reply-To: <459D093E.80600@cadsoft.de> X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2007 02:31:26 -0000 Status: O X-Status: X-Keywords: X-UID: 12680 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. 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; }