diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-05-28 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-05-28 18:00:00 +0200 |
commit | 177b875945e5898ebc07d79527e0ddc5e4e0f93d (patch) | |
tree | 2227730ee8d6e28c918b8fdb59f8c4a680ed12d0 /nit.c | |
parent | 5d8e3b18dc610e2696606092ba66e1477eccce88 (diff) | |
download | vdr-patch-lnbsharing-177b875945e5898ebc07d79527e0ddc5e4e0f93d.tar.gz vdr-patch-lnbsharing-177b875945e5898ebc07d79527e0ddc5e4e0f93d.tar.bz2 |
Version 1.4.0-2vdr-1.4.0-2
- Removed leftover LSMOD=... line from 'runvdr'.
- Modified the Makefile to copy additional libraries a plugin might provide (suggested
by Wayne Keer). See PLUGINS.html for details.
- Fixed handling Transfer Mode when replaying Dolby Digital audio and the option
'-a' was given (based on a patch from Werner Fink). To avoid having to increment
the API version, several #if checks have been introduced around this. These will
be removed once the API version actually needs to be incremented.
- Fixed deleting the 'skinDescriptions' in cMenuSetupOSD::~cMenuSetupOSD() (thanks
to Tobias Grimm).
- Fixed calculating the start time of repeated timers with "first day" (thanks to
Udo Richter).
- Now setting a timer's cached start time to 0 after a call to Skip() (thanks to
Udo Richter).
- Fixed handling the running status of EPG events in case the "Schedule" menu is
currently open (i.e. a write lock on the schedules data can't be achieved).
- Fixed handling VPS timers in case the EPG event hasn't been 'seen' in a while.
- Fixed calculating the cache size in cUnbufferedFile::Read() (thanks to Artur Skawina).
- Removed -fPIC from VDR's and libsi's Makefile (suggested by Prakash Punnoor).
- Modifed the device selection to better handle timer conflicts (reported by
Christian Wieninger).
- Avoiding a compiler warning in libsi's TypeLoop::operator[].
- Now processing the "frequency list descriptor" (based on a patch from Anssi Hannula).
- Improved the repeat function for LIRC remote controls (thanks to Joerg Riechardt).
- Fixed moving channels, which sometimes stopped the current replay session
(reported by Mirko Dölle).
- Fixed deleting channels in case the current channel's number changes (reported
by Mirko Dölle).
Diffstat (limited to 'nit.c')
-rw-r--r-- | nit.c | 142 |
1 files changed, 104 insertions, 38 deletions
@@ -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; |