From patchwork Sun Feb 24 06:20:24 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ua0lnj X-Patchwork-Id: 12607 Received: from mx30.mail.ru ([194.67.23.238]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1JTAEe-0005Zm-9c for vdr@linuxtv.org; Sun, 24 Feb 2008 07:21:16 +0100 Received: from [86.102.40.253] (port=52890 helo=[192.168.1.2]) by mx30.mail.ru with asmtp id 1JTAE5-0002To-00 for vdr@linuxtv.org; Sun, 24 Feb 2008 09:20:41 +0300 From: ua0lnj To: VDR Mailing List In-Reply-To: <47C051F1.5080604@cadsoft.de> References: <00c801c87503$2f829da0$0201a8c0@ua0lnjhome> <47C051F1.5080604@cadsoft.de> Date: Sun, 24 Feb 2008 16:20:24 +1000 Message-Id: <1203834024.14699.23.camel@ua0lnjhome> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 (2.12.1-3.fc8) Subject: Re: [vdr] [patch] channels with same pids X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 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: Sun, 24 Feb 2008 06:21:16 -0000 Status: O X-Status: X-Keywords: X-UID: 15840 Hi 1. cChannel::PluginParam() need for iptv plugin. sorry, i was attached bad version for native vdr. See attach for this message. 2. You right of cause, the triplet SID/NID/TID is supposed to be unique within one satellite, but in really we have incorrect pid tables on many satellites, and in local iptv networks. Example, see http://www.lyngsat.com/eam2.html, some channels have equal pids: 11650V, 11190H, and 11044H too. This is fault of sat providers, but we have it as is. And be a fine, if vdr can works correct with such channels, without editing channel.conf manually. On Sat, 23/02/2008 18:03 +0100, Klaus Schmidinger wrote: > On 02/22/08 04:29, ua0lnj wrote: > > Hi. > > Some satellites have many channels with same sid, nid, tid on different > > transponders. This is incorrect pid table, and vdr works with it not > > good, need scan channels and change rid manually, but if you select > > "transponder update" all you settings will be rewrite and channels > > deleted as duplicate. > > I have this trouble on ABS1 75.0 E and Express AM2 80.0 E, and I have > > very many channels with same pids on my iptv stream. > > After this patch, vdr parsing duplicate pids, and if transponders is > > not equal, channel not deleted, but rid wil be increased. If pids and > > transponders are equal, channel will be deleted as duplicate. > > Patch was made for vdr-1.5.12, but works with 1.5.15 too. > > Attached 3 patches, for native vdr and vdr + iptv plugin patched and for > > native reelchannelscan-0.4.1 plugin (include patch for 1.5.xx). > > First of all, there is no cChannel::PluginParam() in plain vanilla VDR 1.5.15. > > Secondly, as far as I understand this, the triplet SID/NID/TID is supposed > to be unique within one satellite. > Can you point me to a standard document that would indicate otherwise? > > Klaus > > _______________________________________________ > vdr mailing list > vdr@linuxtv.org > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr diff -Nup vdr-1.5.12/channels.c vdr-1.5.12mod/channels.c --- vdr-1.5.12/channels.c 2007-10-13 01:40:53.000000000 +1100 +++ vdr-1.5.12mod/channels.c 2008-01-08 23:41:56.000000000 +1000 @@ -876,6 +876,7 @@ cChannels::cChannels(void) modified = CHANNELSMOD_NONE; } + void cChannels::DeleteDuplicateChannels(void) { cList ChannelSorter; @@ -887,12 +888,21 @@ void cChannels::DeleteDuplicateChannels( cChannelSorter *cs = ChannelSorter.First(); while (cs) { cChannelSorter *next = ChannelSorter.Next(cs); - if (next && cs->channelID == next->channelID) { + if (next && cs->channelID == next->channelID && cs->channel->Transponder() == next->channel->Transponder()) { dsyslog("deleting duplicate channel %s", *next->channel->ToText()); Del(next->channel); } - cs = next; - } + else if (next && cs->channelID == next->channelID) { + dsyslog("deleting duplicate id %s", *next->channel->ToText()); + int sid = cs->channel->Sid(); + int nid = cs->channel->Nid(); + int tid = cs->channel->Tid(); + int rid = cs->channel->Rid(); + next->channel->SetId(nid, tid, sid, rid+1); + } + cs = next; + } + Channels.Save(); } bool cChannels::Load(const char *FileName, bool AllowComments, bool MustExist) diff -Nup vdr-1.5.12/nit.c vdr-1.5.12mod/nit.c --- vdr-1.5.12/nit.c 2007-08-18 01:02:45.000000000 +1100 +++ vdr-1.5.12mod/nit.c 2007-12-29 13:39:39.000000000 +1000 @@ -143,7 +143,7 @@ void cNitFilter::Process(u_short Pid, u_ if (Setup.UpdateChannels >= 5) { bool found = false; 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 (!Channel->GroupSep() && Channel->Source() == Source && Channel->Transponder() == Transponder() && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) { int transponder = Channel->Transponder(); if (!ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), transponder)) { for (int n = 0; n < NumFrequencies; n++) { diff -Nup vdr-1.5.12/sdt.c vdr-1.5.12mod/sdt.c --- vdr-1.5.12/sdt.c 2007-06-10 19:50:49.000000000 +1100 +++ vdr-1.5.12mod/sdt.c 2008-01-08 23:48:59.000000000 +1000 @@ -78,7 +78,7 @@ void cSdtFilter::Process(u_short Pid, u_ char *pp = compactspace(ProviderNameBuf); if (channel) { channel->SetId(sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()); - if (Setup.UpdateChannels == 1 || Setup.UpdateChannels >= 3) + if ((Setup.UpdateChannels == 1 || Setup.UpdateChannels >= 3) && channel->Transponder() == Transponder()) channel->SetName(pn, ps, pp); // Using SiSdtService.getFreeCaMode() is no good, because some // tv stations set this flag even for non-encrypted channels :-(