summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-01-11 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-01-11 18:00:00 +0100
commita76a03c0d815680e3e8fc52f24f60a30177d3021 (patch)
tree50c39ea8e54d1d4242f10ab636e8500505201e5b /channels.c
parent93a94b18b540fbcb9bcdaaea9abd26cdf23d6ee6 (diff)
downloadvdr-patch-lnbsharing-a76a03c0d815680e3e8fc52f24f60a30177d3021.tar.gz
vdr-patch-lnbsharing-a76a03c0d815680e3e8fc52f24f60a30177d3021.tar.bz2
Version 1.3.1vdr-1.3.1
- Fixed a lockup in the EPG scanner when no non-primary device was available (thanks to Martin Holst for reporting this one). - Fixed a compiler warning about virtual cConfig::Load() functions (thanks to Lauri Tischler for reporting this one). - Fixed a warning about character comparison in libsi/si.c (thanks to Lauri Tischler for reporting this one). - The new parameter "Update channels" in the "Setup/DVB" menu can be used to control if and how channels will be automatically updated (see MANUAL). This has already been part of the 'autopid' patch by Andreas Schultz and has now been adopted. - Fixed a crash in case there is no DVB hardware present (thanks to Sascha Volkenandt for reporting this one). - Changed calculation of channel ids to make it work for tv stations that use the undefined NID value 0 (thanks to Teemu Rantanen for reporting this one). - Enhanced the SDT filter to handle multi part sections. - Added support for selecting preferred EPG languages (based upon a patch by Teemu Rantanen). - Fixed a 'const' in libsi/si.h (thanks to Marcel Wiesweg). - Fixed the 'su' call in 'runvdr' to make it work on systems that require the user name to appear before the command option (thanks to Robert Huitl). - Fixed testing for matching section filters in case they are turned off (thanks to Marcel Wiesweg). - In case of incomplete sections an error message is now logged only every 10 seconds. - Fixed a possible NULL pointer access in cEITScanner::Process() (thanks to Andreas Kool). - The actual transponder data is now taken from the NIT and existing channels are adjusted if necessary. If the NIT contains new transponders, they are scanned for channels during the next EPG scan. Note that only the satellite branches are tested, cable and terrestrial need to be tested by somebody who actually has such equipment.
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c111
1 files changed, 76 insertions, 35 deletions
diff --git a/channels.c b/channels.c
index 9a7965f..67ee2b5 100644
--- a/channels.c
+++ b/channels.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 1.17 2004/01/04 12:28:49 kls Exp $
+ * $Id: channels.c 1.19 2004/01/11 15:52:32 kls Exp $
*/
#include "channels.h"
@@ -160,25 +160,6 @@ char *cChannel::buffer = NULL;
cChannel::cChannel(void)
{
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
- strcpy(name, "Pro7");
- frequency = 12480;
- source = cSource::FromString("S19.2E");
- srate = 27500;
- vpid = 255;
- ppid = 0;
- apid1 = 256;
- apid2 = 0;
- dpid1 = 257;
- dpid2 = 0;
- tpid = 32;
- caids[0] = 0;
- nid = 0;
- tid = 0;
- sid = 888;
- rid = 0;
- number = 0;
- groupSep = false;
- polarization = 'v';
inversion = INVERSION_AUTO;
bandwidth = BANDWIDTH_AUTO;
coderateH = FEC_AUTO;
@@ -227,7 +208,7 @@ int cChannel::Transponder(void) const
tChannelID cChannel::GetChannelID(void) const
{
- return tChannelID(source, nid, nid ? tid : Transponder(), sid, rid);
+ return tChannelID(source, nid, (nid || tid) ? tid : Transponder(), sid, rid);
}
int cChannel::Modification(int Mask)
@@ -237,6 +218,68 @@ int cChannel::Modification(int Mask)
return Result;
}
+bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, bool Log)
+{
+ // Workarounds for broadcaster stupidity:
+ // Some providers broadcast the transponder frequency of their channels with two different
+ // values (like 12551 and 12552), so we need to allow for a little tolerance here
+ if (abs(frequency - Frequency) <= 1)
+ Frequency = frequency;
+ // Sometimes the transponder frequency is set to 0, which is just wrong
+ if (Frequency == 0)
+ return false;
+
+ if (source != Source || frequency != Frequency || polarization != Polarization || srate != Srate || coderateH != CoderateH) {
+ if (Log)
+ dsyslog("changing transponder data of channel %d from %s:%d:%c:%d:%d to %s:%d:%c:%d:%d", Number(), cSource::ToString(source), frequency, polarization, srate, coderateH, cSource::ToString(Source), Frequency, Polarization, Srate, CoderateH);
+ source = Source;
+ frequency = Frequency;
+ polarization = Polarization;
+ srate = Srate;
+ coderateH = CoderateH;
+ modulation = QPSK;
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ return true;
+}
+
+bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH, bool Log)
+{
+ if (source != Source || frequency != Frequency || modulation != Modulation || srate != Srate || coderateH != CoderateH) {
+ if (Log)
+ dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d to %s:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, modulation, srate, coderateH, cSource::ToString(Source), Frequency, Modulation, Srate, CoderateH);
+ source = Source;
+ frequency = Frequency;
+ modulation = Modulation;
+ srate = Srate;
+ coderateH = CoderateH;
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ return true;
+}
+
+bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission, bool Log)
+{
+ if (source != Source || frequency != Frequency || bandwidth != Bandwidth || modulation != Modulation || hierarchy != Hierarchy || coderateH != CoderateH || coderateL != CoderateL || guard != Guard || transmission != Transmission) {
+ if (Log)
+ dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d:%d:%d:%d:%d to %s:%d:%d:%d:%d:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, bandwidth, modulation, hierarchy, coderateH, coderateL, guard, transmission, cSource::ToString(Source), Frequency, Bandwidth, Modulation, Hierarchy, CoderateH, CoderateL, Guard, Transmission);
+ source = Source;
+ frequency = Frequency;
+ bandwidth = Bandwidth;
+ modulation = Modulation;
+ hierarchy = Hierarchy;
+ coderateH = CoderateH;
+ coderateL = CoderateL;
+ guard = Guard;
+ transmission = Transmission;
+ modification |= CHANNELMOD_TRANSP;
+ Channels.SetModified();
+ }
+ return true;
+}
+
void cChannel::SetId(int Nid, int Tid, int Sid, int Rid, bool Log)
{
if (nid != Nid || tid != Tid || sid != Sid || rid != Rid) {
@@ -382,9 +425,9 @@ bool cChannel::StringToParameters(const char *s)
case 'G': s = ParseParameter(s, guard, GuardValues); break;
case 'H': polarization = *s++; break;
case 'I': s = ParseParameter(s, inversion, InversionValues); break;
- // 'L' reserved for possible circular polarization
+ case 'L': polarization = *s++; break;
case 'M': s = ParseParameter(s, modulation, ModulationValues); break;
- // 'R' reserved for possible circular polarization
+ case 'R': polarization = *s++; break;
case 'T': s = ParseParameter(s, transmission, TransmissionValues); break;
case 'V': polarization = *s++; break;
case 'Y': s = ParseParameter(s, hierarchy, HierarchyValues); break;
@@ -675,18 +718,16 @@ bool cChannels::Modified(void)
return Result;
}
-cChannel *cChannels::NewChannel(int Source, int Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid)
+cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid)
{
- dsyslog("creating new channel '%s' on %s transponder %d with id %d-%d-%d-%d", Name, cSource::ToString(Source), Transponder, Nid, Tid, Sid, Rid);
- for (cChannel *channel = First(); channel; channel = Next(channel)) {
- if (!channel->GroupSep() && channel->Source() == Source && ISTRANSPONDER(channel->Transponder(), Transponder)) {
- cChannel *NewChannel = new cChannel(channel);
- Add(NewChannel);
- ReNumber();
- NewChannel->SetId(Nid, Tid, Sid, Rid, false);
- NewChannel->SetName(Name, false);
- return NewChannel;
- }
- }
+ if (Transponder) {
+ dsyslog("creating new channel '%s' on %s transponder %d with id %d-%d-%d-%d", Name, cSource::ToString(Transponder->Source()), Transponder->Transponder(), Nid, Tid, Sid, Rid);
+ cChannel *NewChannel = new cChannel(Transponder);
+ Add(NewChannel);
+ ReNumber();
+ NewChannel->SetId(Nid, Tid, Sid, Rid, false);
+ NewChannel->SetName(Name, false);
+ return NewChannel;
+ }
return NULL;
}