mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed transponder handling to make it work with satellites that provide two transponders on the same frequency, with different polarization
This commit is contained in:
parent
30d262fa88
commit
06d5342393
@ -933,3 +933,5 @@ Andreas Regel <andreas.regel@gmx.de>
|
|||||||
Thomas Bergwinkl <Thomas.Bergwinkl@t-online.de>
|
Thomas Bergwinkl <Thomas.Bergwinkl@t-online.de>
|
||||||
for fixing the validity check for channel IDs, because some providers use TIDs
|
for fixing the validity check for channel IDs, because some providers use TIDs
|
||||||
with value 0
|
with value 0
|
||||||
|
for pointing out that transponder handling didn't work with satellites that provide
|
||||||
|
two transponders on the same frequency, with different polarization
|
||||||
|
4
HISTORY
4
HISTORY
@ -2659,3 +2659,7 @@ Video Disk Recorder Revision History
|
|||||||
a video nor an audio PID.
|
a video nor an audio PID.
|
||||||
- Fixed editing channels (SID now range checked) and creating new channels (NID,
|
- Fixed editing channels (SID now range checked) and creating new channels (NID,
|
||||||
TID and RID are now set to 0).
|
TID and RID are now set to 0).
|
||||||
|
- Fixed transponder handling to make it work with satellites that provide two
|
||||||
|
transponders on the same frequency, with different polarization, like Hispasat
|
||||||
|
at S30.0W (thanks to Thomas Bergwinkl for pointing this out). See man vdr(5)
|
||||||
|
for details about the enhanced channel ID format.
|
||||||
|
32
channels.c
32
channels.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.c 1.23 2004/02/08 11:05:22 kls Exp $
|
* $Id: channels.c 1.24 2004/02/13 15:37:42 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
@ -153,6 +153,13 @@ const char *tChannelID::ToString(void)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tChannelID &tChannelID::ClrPolarization(void)
|
||||||
|
{
|
||||||
|
while (tid > 100000)
|
||||||
|
tid -= 100000;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
// -- cChannel ---------------------------------------------------------------
|
// -- cChannel ---------------------------------------------------------------
|
||||||
|
|
||||||
char *cChannel::buffer = NULL;
|
char *cChannel::buffer = NULL;
|
||||||
@ -220,11 +227,25 @@ cChannel& cChannel::operator= (const cChannel &Channel)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cChannel::Transponder(int Frequency, char Polarization)
|
||||||
|
{
|
||||||
|
// some satellites have transponders at the same frequency, just with different polarization:
|
||||||
|
switch (tolower(Polarization)) {
|
||||||
|
case 'h': Frequency += 100000; break;
|
||||||
|
case 'v': Frequency += 200000; break;
|
||||||
|
case 'l': Frequency += 300000; break;
|
||||||
|
case 'r': Frequency += 400000; break;
|
||||||
|
}
|
||||||
|
return Frequency;
|
||||||
|
}
|
||||||
|
|
||||||
int cChannel::Transponder(void) const
|
int cChannel::Transponder(void) const
|
||||||
{
|
{
|
||||||
int tf = frequency;
|
int tf = frequency;
|
||||||
while (tf > 20000)
|
while (tf > 20000)
|
||||||
tf /= 1000;
|
tf /= 1000;
|
||||||
|
if (IsSat())
|
||||||
|
tf = Transponder(tf, polarization);
|
||||||
return tf;
|
return tf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,7 +824,7 @@ cChannel *cChannels::GetByServiceID(int Source, int Transponder, unsigned short
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cChannel *cChannels::GetByChannelID(tChannelID ChannelID, bool TryWithoutRid)
|
cChannel *cChannels::GetByChannelID(tChannelID ChannelID, bool TryWithoutRid, bool TryWithoutPolarization)
|
||||||
{
|
{
|
||||||
for (cChannel *channel = First(); channel; channel = Next(channel)) {
|
for (cChannel *channel = First(); channel; channel = Next(channel)) {
|
||||||
if (!channel->GroupSep() && channel->GetChannelID() == ChannelID)
|
if (!channel->GroupSep() && channel->GetChannelID() == ChannelID)
|
||||||
@ -816,6 +837,13 @@ cChannel *cChannels::GetByChannelID(tChannelID ChannelID, bool TryWithoutRid)
|
|||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (TryWithoutPolarization) {
|
||||||
|
ChannelID.ClrPolarization();
|
||||||
|
for (cChannel *channel = First(); channel; channel = Next(channel)) {
|
||||||
|
if (!channel->GroupSep() && channel->GetChannelID().ClrPolarization() == ChannelID)
|
||||||
|
return channel;
|
||||||
|
}
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.h 1.15 2004/02/08 12:20:22 kls Exp $
|
* $Id: channels.h 1.16 2004/02/13 15:16:36 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CHANNELS_H
|
#ifndef __CHANNELS_H
|
||||||
@ -61,6 +61,7 @@ public:
|
|||||||
bool operator== (const tChannelID &arg) const;
|
bool operator== (const tChannelID &arg) const;
|
||||||
bool Valid(void) { return (nid || tid) && sid; } // rid is optional and source may be 0//XXX source may not be 0???
|
bool Valid(void) { return (nid || tid) && sid; } // rid is optional and source may be 0//XXX source may not be 0???
|
||||||
tChannelID &ClrRid(void) { rid = 0; return *this; }
|
tChannelID &ClrRid(void) { rid = 0; return *this; }
|
||||||
|
tChannelID &ClrPolarization(void);
|
||||||
static tChannelID FromString(const char *s);
|
static tChannelID FromString(const char *s);
|
||||||
const char *ToString(void);
|
const char *ToString(void);
|
||||||
static const tChannelID InvalidID;
|
static const tChannelID InvalidID;
|
||||||
@ -129,7 +130,8 @@ public:
|
|||||||
bool Save(FILE *f);
|
bool Save(FILE *f);
|
||||||
const char *Name(void) const { return name; }
|
const char *Name(void) const { return name; }
|
||||||
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
|
int Frequency(void) const { return frequency; } ///< Returns the actual frequency, as given in 'channels.conf'
|
||||||
int Transponder(void) const; ///< Returns the transponder frequency in MHz
|
int Transponder(void) const; ///< Returns the transponder frequency in MHz, plus the polarization in case of sat
|
||||||
|
static int Transponder(int Frequency, char Polarization); ///< builds the transponder from the given Frequency and Polarization
|
||||||
int Source(void) const { return source; }
|
int Source(void) const { return source; }
|
||||||
int Srate(void) const { return srate; }
|
int Srate(void) const { return srate; }
|
||||||
int Vpid(void) const { return vpid; }
|
int Vpid(void) const { return vpid; }
|
||||||
@ -187,7 +189,7 @@ public:
|
|||||||
void ReNumber(void); // Recalculate 'number' based on channel type
|
void ReNumber(void); // Recalculate 'number' based on channel type
|
||||||
cChannel *GetByNumber(int Number, int SkipGap = 0);
|
cChannel *GetByNumber(int Number, int SkipGap = 0);
|
||||||
cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID);
|
cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID);
|
||||||
cChannel *GetByChannelID(tChannelID ChannelID, bool TryWithoutRid = false);
|
cChannel *GetByChannelID(tChannelID ChannelID, bool TryWithoutRid = false, bool TryWithoutPolarization = false);
|
||||||
int BeingEdited(void) { return beingEdited; }
|
int BeingEdited(void) { return beingEdited; }
|
||||||
void IncBeingEdited(void) { beingEdited++; }
|
void IncBeingEdited(void) { beingEdited++; }
|
||||||
void DecBeingEdited(void) { beingEdited--; }
|
void DecBeingEdited(void) { beingEdited--; }
|
||||||
|
4
nit.c
4
nit.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: nit.c 1.5 2004/01/18 16:32:45 kls Exp $
|
* $Id: nit.c 1.6 2004/02/13 14:41:36 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nit.h"
|
#include "nit.h"
|
||||||
@ -106,7 +106,7 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
|
|||||||
int CodeRate = CodeRates[sd->getFecInner()];
|
int CodeRate = CodeRates[sd->getFecInner()];
|
||||||
int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
|
int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
|
||||||
if (ThisNIT >= 0) {
|
if (ThisNIT >= 0) {
|
||||||
if (ISTRANSPONDER(Frequency, Transponder())) {
|
if (ISTRANSPONDER(cChannel::Transponder(Frequency, Polarization), Transponder())) {
|
||||||
nits[ThisNIT].hasTransponder = true;
|
nits[ThisNIT].hasTransponder = true;
|
||||||
//printf("has transponder %d\n", Transponder());
|
//printf("has transponder %d\n", Transponder());
|
||||||
}
|
}
|
||||||
|
4
timers.c
4
timers.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: timers.c 1.8 2003/12/27 13:10:04 kls Exp $
|
* $Id: timers.c 1.9 2004/02/13 15:37:49 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
@ -219,7 +219,7 @@ bool cTimer::Parse(const char *s)
|
|||||||
if (isnumber(channelbuffer))
|
if (isnumber(channelbuffer))
|
||||||
channel = Channels.GetByNumber(atoi(channelbuffer));
|
channel = Channels.GetByNumber(atoi(channelbuffer));
|
||||||
else
|
else
|
||||||
channel = Channels.GetByChannelID(tChannelID::FromString(channelbuffer), true);
|
channel = Channels.GetByChannelID(tChannelID::FromString(channelbuffer), true, true);
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
esyslog("ERROR: channel %s not defined", channelbuffer);
|
esyslog("ERROR: channel %s not defined", channelbuffer);
|
||||||
result = false;
|
result = false;
|
||||||
|
9
vdr.5
9
vdr.5
@ -8,7 +8,7 @@
|
|||||||
.\" License as specified in the file COPYING that comes with the
|
.\" License as specified in the file COPYING that comes with the
|
||||||
.\" vdr distribution.
|
.\" vdr distribution.
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: vdr.5 1.23 2004/01/25 14:44:59 kls Exp $
|
.\" $Id: vdr.5 1.24 2004/02/13 14:55:09 kls Exp $
|
||||||
.\"
|
.\"
|
||||||
.TH vdr 5 "1 Jun 2003" "1.2.0" "Video Disk Recorder Files"
|
.TH vdr 5 "1 Jun 2003" "1.2.0" "Video Disk Recorder Files"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
@ -178,6 +178,13 @@ so the above example could also be written as S19.2E-1-1089-12003).
|
|||||||
.br
|
.br
|
||||||
The \fBchannel\ ID\fR is used in the \fItimers.conf\fR and \fIepg.data\fR
|
The \fBchannel\ ID\fR is used in the \fItimers.conf\fR and \fIepg.data\fR
|
||||||
files to properly identify the channels.
|
files to properly identify the channels.
|
||||||
|
|
||||||
|
If a channel has both \fBNID\fR and \fBTID\fR set to 0, the \fBchannel\ ID\fR
|
||||||
|
will use the \fBFrequency\fR instead of the \fBTID\fR. For satellite channels
|
||||||
|
an additional offset of 100000, 200000, 300000 or 400000 is added to that
|
||||||
|
number, depending on the \fBPolarization\fR (\fBH\fR, \fBV\fR, \fBL\fR or \fBR\fR,
|
||||||
|
respectively). This is necessary because on some satellites the same frequency is
|
||||||
|
used for two different transponders, with opposite polarization.
|
||||||
.SS TIMERS
|
.SS TIMERS
|
||||||
The file \fItimers.conf\fR contains the timer setup.
|
The file \fItimers.conf\fR contains the timer setup.
|
||||||
Each line contains one timer definition, with individual fields
|
Each line contains one timer definition, with individual fields
|
||||||
|
Loading…
Reference in New Issue
Block a user