From 177b875945e5898ebc07d79527e0ddc5e4e0f93d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 28 May 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.4.0-2=20-=20Removed=20leftover=20LSMOD=3D..?= =?UTF-8?q?.=20line=20from=20'runvdr'.=20-=20Modified=20the=20Makefile=20t?= =?UTF-8?q?o=20copy=20additional=20libraries=20a=20plugin=20might=20provid?= =?UTF-8?q?e=20(suggested=20=20=20by=20Wayne=20Keer).=20See=20PLUGINS.html?= =?UTF-8?q?=20for=20details.=20-=20Fixed=20handling=20Transfer=20Mode=20wh?= =?UTF-8?q?en=20replaying=20Dolby=20Digital=20audio=20and=20the=20option?= =?UTF-8?q?=20=20=20'-a'=20was=20given=20(based=20on=20a=20patch=20from=20?= =?UTF-8?q?Werner=20Fink).=20To=20avoid=20having=20to=20increment=20=20=20?= =?UTF-8?q?the=20API=20version,=20several=20#if=20checks=20have=20been=20i?= =?UTF-8?q?ntroduced=20around=20this.=20These=20will=20=20=20be=20removed?= =?UTF-8?q?=20once=20the=20API=20version=20actually=20needs=20to=20be=20in?= =?UTF-8?q?cremented.=20-=20Fixed=20deleting=20the=20'skinDescriptions'=20?= =?UTF-8?q?in=20cMenuSetupOSD::~cMenuSetupOSD()=20(thanks=20=20=20to=20Tob?= =?UTF-8?q?ias=20Grimm).=20-=20Fixed=20calculating=20the=20start=20time=20?= =?UTF-8?q?of=20repeated=20timers=20with=20"first=20day"=20(thanks=20to=20?= =?UTF-8?q?=20=20Udo=20Richter).=20-=20Now=20setting=20a=20timer's=20cache?= =?UTF-8?q?d=20start=20time=20to=200=20after=20a=20call=20to=20Skip()=20(t?= =?UTF-8?q?hanks=20to=20=20=20Udo=20Richter).=20-=20Fixed=20handling=20the?= =?UTF-8?q?=20running=20status=20of=20EPG=20events=20in=20case=20the=20"Sc?= =?UTF-8?q?hedule"=20menu=20is=20=20=20currently=20open=20(i.e.=20a=20writ?= =?UTF-8?q?e=20lock=20on=20the=20schedules=20data=20can't=20be=20achieved)?= =?UTF-8?q?.=20-=20Fixed=20handling=20VPS=20timers=20in=20case=20the=20EPG?= =?UTF-8?q?=20event=20hasn't=20been=20'seen'=20in=20a=20while.=20-=20Fixed?= =?UTF-8?q?=20calculating=20the=20cache=20size=20in=20cUnbufferedFile::Rea?= =?UTF-8?q?d()=20(thanks=20to=20Artur=20Skawina).=20-=20Removed=20-fPIC=20?= =?UTF-8?q?from=20VDR's=20and=20libsi's=20Makefile=20(suggested=20by=20Pra?= =?UTF-8?q?kash=20Punnoor).=20-=20Modifed=20the=20device=20selection=20to?= =?UTF-8?q?=20better=20handle=20timer=20conflicts=20(reported=20by=20=20?= =?UTF-8?q?=20Christian=20Wieninger).=20-=20Avoiding=20a=20compiler=20warn?= =?UTF-8?q?ing=20in=20libsi's=20TypeLoop::operator[].=20-=20Now=20processi?= =?UTF-8?q?ng=20the=20"frequency=20list=20descriptor"=20(based=20on=20a=20?= =?UTF-8?q?patch=20from=20Anssi=20Hannula).=20-=20Improved=20the=20repeat?= =?UTF-8?q?=20function=20for=20LIRC=20remote=20controls=20(thanks=20to=20J?= =?UTF-8?q?oerg=20Riechardt).=20-=20Fixed=20moving=20channels,=20which=20s?= =?UTF-8?q?ometimes=20stopped=20the=20current=20replay=20session=20=20=20(?= =?UTF-8?q?reported=20by=20Mirko=20D=C3=B6lle).=20-=20Fixed=20deleting=20c?= =?UTF-8?q?hannels=20in=20case=20the=20current=20channel's=20number=20chan?= =?UTF-8?q?ges=20(reported=20=20=20by=20Mirko=20D=C3=B6lle).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nit.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 38 deletions(-) (limited to 'nit.c') diff --git a/nit.c b/nit.c index 27b90fd..007093d 100644 --- a/nit.c +++ b/nit.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: nit.c 1.11 2006/04/15 14:10:42 kls Exp $ + * $Id: nit.c 1.12 2006/05/27 15:35:16 kls Exp $ */ #include "nit.h" @@ -48,7 +48,7 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length if (nits[j].hasTransponder) { networkId = nits[j].networkId; //printf("taking NIT with network ID %d\n", networkId); - //XXX what if more than one NIT contaisn this transponder??? + //XXX what if more than one NIT contains this transponder??? break; } } @@ -95,46 +95,84 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length SI::NIT::TransportStream ts; for (SI::Loop::Iterator it; nit.transportStreamLoop.getNext(ts, it); ) { SI::Descriptor *d; + + SI::Loop::Iterator it2; + SI::FrequencyListDescriptor *fld = (SI::FrequencyListDescriptor *)ts.transportStreamDescriptors.getNext(it2, SI::FrequencyListDescriptorTag); + int NumFrequencies = fld ? fld->frequencies.getCount() + 1 : 1; + int Frequencies[NumFrequencies]; + if (fld) { + int ct = fld->getCodingType(); + if (ct > 0) { + int n = 1; + for (SI::Loop::Iterator it3; fld->frequencies.hasNext(it3); ) { + int f = fld->frequencies.getNext(it3); + switch (ct) { + case 1: f = BCD2INT(f) / 100; break; + case 2: f = BCD2INT(f) / 10; break; + case 3: f = f * 10; break; + } + Frequencies[n++] = f; + } + } + else + NumFrequencies = 1; + } + delete fld; + for (SI::Loop::Iterator it2; (d = ts.transportStreamDescriptors.getNext(it2)); ) { switch (d->getDescriptorTag()) { case SI::SatelliteDeliverySystemDescriptorTag: { SI::SatelliteDeliverySystemDescriptor *sd = (SI::SatelliteDeliverySystemDescriptor *)d; int Source = cSource::FromData(cSource::stSat, BCD2INT(sd->getOrbitalPosition()), sd->getWestEastFlag()); - int Frequency = BCD2INT(sd->getFrequency()) / 100; + int Frequency = Frequencies[0] = BCD2INT(sd->getFrequency()) / 100; static char Polarizations[] = { 'h', 'v', 'l', 'r' }; char Polarization = Polarizations[sd->getPolarization()]; static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_NONE }; int CodeRate = CodeRates[sd->getFecInner()]; int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10; if (ThisNIT >= 0) { - if (ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Transponder())) { - nits[ThisNIT].hasTransponder = true; - //printf("has transponder %d\n", Transponder()); - } + for (int n = 0; n < NumFrequencies; n++) { + if (ISTRANSPONDER(cChannel::Transponder(Frequencies[n], Polarization), Transponder())) { + nits[ThisNIT].hasTransponder = true; + //printf("has transponder %d\n", Transponder()); + break; + } + } break; } 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 (Setup.UpdateChannels >= 5) + if (Setup.UpdateChannels >= 5) { + 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); + } found = true; } } if (!found && Setup.UpdateChannels >= 5) { - cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); - if (Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate)) - EITScanner.AddTransponder(Channel); - else - delete Channel; + for (int n = 0; n < NumFrequencies; n++) { + cChannel *Channel = new cChannel; + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetSatTransponderData(Source, Frequencies[n], Polarization, SymbolRate, CodeRate)) + EITScanner.AddTransponder(Channel); + else + delete Channel; + } } } break; case SI::CableDeliverySystemDescriptorTag: { SI::CableDeliverySystemDescriptor *sd = (SI::CableDeliverySystemDescriptor *)d; int Source = cSource::FromData(cSource::stCable); - int Frequency = BCD2INT(sd->getFrequency()) / 10; + int Frequency = Frequencies[0] = BCD2INT(sd->getFrequency()) / 10; //XXX FEC_outer??? static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_NONE }; int CodeRate = CodeRates[sd->getFecInner()]; @@ -142,34 +180,48 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length int Modulation = Modulations[min(sd->getModulation(), 6)]; int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10; if (ThisNIT >= 0) { - if (ISTRANSPONDER(Frequency / 1000, Transponder())) { - nits[ThisNIT].hasTransponder = true; - //printf("has transponder %d\n", Transponder()); - } + for (int n = 0; n < NumFrequencies; n++) { + if (ISTRANSPONDER(Frequencies[n] / 1000, Transponder())) { + nits[ThisNIT].hasTransponder = true; + //printf("has transponder %d\n", Transponder()); + break; + } + } break; } 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 (Setup.UpdateChannels >= 5) + if (Setup.UpdateChannels >= 5) { + 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); + } found = true; } } if (!found && Setup.UpdateChannels >= 5) { - cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); - if (Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate)) - EITScanner.AddTransponder(Channel); - else - delete Channel; + for (int n = 0; n < NumFrequencies; n++) { + cChannel *Channel = new cChannel; + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetCableTransponderData(Source, Frequencies[n], Modulation, SymbolRate, CodeRate)) + EITScanner.AddTransponder(Channel); + else + delete Channel; + } } } break; case SI::TerrestrialDeliverySystemDescriptorTag: { SI::TerrestrialDeliverySystemDescriptor *sd = (SI::TerrestrialDeliverySystemDescriptor *)d; int Source = cSource::FromData(cSource::stTerr); - int Frequency = sd->getFrequency() * 10; + int Frequency = Frequencies[0] = sd->getFrequency() * 10; static int Bandwidths[] = { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_6_MHZ, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO }; int Bandwidth = Bandwidths[sd->getBandwidth()]; static int Constellations[] = { QPSK, QAM_16, QAM_64, QAM_AUTO }; @@ -184,27 +236,41 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length static int TransmissionModes[] = { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_AUTO }; int TransmissionMode = TransmissionModes[sd->getTransmissionMode()]; if (ThisNIT >= 0) { - if (ISTRANSPONDER(Frequency / 1000000, Transponder())) { - nits[ThisNIT].hasTransponder = true; - //printf("has transponder %d\n", Transponder()); - } + for (int n = 0; n < NumFrequencies; n++) { + if (ISTRANSPONDER(Frequencies[n] / 1000000, Transponder())) { + nits[ThisNIT].hasTransponder = true; + //printf("has transponder %d\n", Transponder()); + break; + } + } break; } 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 (Setup.UpdateChannels >= 5) + if (Setup.UpdateChannels >= 5) { + 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); + } found = true; } } if (!found && Setup.UpdateChannels >= 5) { - cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); - if (Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode)) - EITScanner.AddTransponder(Channel); - else - delete Channel; + for (int n = 0; n < NumFrequencies; n++) { + cChannel *Channel = new cChannel; + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetTerrTransponderData(Source, Frequencies[n], Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode)) + EITScanner.AddTransponder(Channel); + else + delete Channel; + } } } break; -- cgit v1.2.3