Frequency for DVB-C and DVB-T is now in MHz, kHz or Hz

This commit is contained in:
Klaus Schmidinger 2002-10-20 14:15:40 +02:00
parent e3aaeccee3
commit bff56bb850
3 changed files with 19 additions and 7 deletions

View File

@ -1629,3 +1629,6 @@ Video Disk Recorder Revision History
handle gaps in channel numbers, and in preparation for unique channel ids).
- Fixed slow reaction on SVDRP input (thanks to Guido Fiala for reporting this one).
- Added KI.KA to channels.conf.cable (thanks to Robert Schiele).
- Frequency values for cable and terrestrial channels in 'channels.conf' can
now be given either in MHz, kHz or Hz. The actual value given will be multiplied
by 1000 until it is larger than 1000000.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbdevice.c 1.25 2002/10/19 10:12:12 kls Exp $
* $Id: dvbdevice.c 1.26 2002/10/20 14:10:49 kls Exp $
*/
#include "dvbdevice.h"
@ -428,6 +428,13 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
return result;
}
static unsigned int FrequencyToHz(unsigned int f)
{
while (f && f < 1000000)
f *= 1000;
return f;
}
bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
{
#if (DVB_DRIVER_VERSION < MIN_DVB_DRIVER_VERSION_FOR_TIMESHIFT)
@ -622,13 +629,13 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Frequency and symbol rate:
#ifdef NEWSTRUCT
Frontend.frequency = Channel->Frequency() * 1000000UL;
Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.qam.symbol_rate = Channel->Srate() * 1000UL;
Frontend.u.qam.fec_inner = fe_code_rate_t(Channel->CoderateH());
Frontend.u.qam.modulation = fe_modulation_t(Channel->Modulation());
#else
Frontend.Frequency = Channel->Frequency() * 1000000UL;
Frontend.Frequency = FrequencyToHz(Channel->Frequency());
Frontend.Inversion = SpectralInversion(Channel->Inversion());
Frontend.u.qam.SymbolRate = Channel->Srate() * 1000UL;
Frontend.u.qam.FEC_inner = CodeRate(Channel->CoderateH());
@ -641,7 +648,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// Frequency and OFDM paramaters:
#ifdef NEWSTRUCT
Frontend.frequency = Channel->Frequency() * 1000UL;
Frontend.frequency = FrequencyToHz(Channel->Frequency());
Frontend.inversion = fe_spectral_inversion_t(Channel->Inversion());
Frontend.u.ofdm.bandwidth = fe_bandwidth_t(Channel->Bandwidth());
Frontend.u.ofdm.code_rate_HP = fe_code_rate_t(Channel->CoderateH());
@ -651,7 +658,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
Frontend.u.ofdm.guard_interval = fe_guard_interval_t(Channel->Guard());
Frontend.u.ofdm.hierarchy_information = fe_hierarchy_t(Channel->Hierarchy());
#else
Frontend.Frequency = Channel->Frequency() * 1000UL;
Frontend.Frequency = FrequencyToHz(Channel->Frequency());
Frontend.Inversion = SpectralInversion(Channel->Inversion());
Frontend.u.ofdm.bandWidth = BandWidth(Channel->Bandwidth());
Frontend.u.ofdm.HP_CodeRate = CodeRate(Channel->CoderateH());

6
vdr.5
View File

@ -8,7 +8,7 @@
.\" License as specified in the file COPYING that comes with the
.\" vdr distribution.
.\"
.\" $Id: vdr.5 1.9 2002/10/19 12:45:23 kls Exp $
.\" $Id: vdr.5 1.10 2002/10/20 14:15:40 kls Exp $
.\"
.TH vdr 5 "7 Oct 2002" "1.2.0" "Video Disk Recorder Files"
.SH NAME
@ -52,7 +52,9 @@ The channel's name (if the name originally contains a ':' character
it has to be replaced by '|').
.TP
.B Frequency
The transponder frequency in MHz for DVB-S and DVB-C, kHz for DVB-T (as an integer).
The transponder frequency (as an integer). For DVB-S this value is in MHz. For DVB-C
and DVB-T it can be given either in MHz, kHz or Hz (the actual value given will be
multiplied by 1000 until it is larger than 1000000).
.TP
.B Parameters
Various parameters, depending on whether this is a DVB-S, DVB-C or DVB-T channel.