summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-10-20 14:15:40 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-10-20 14:15:40 +0200
commitbff56bb85073ee25a1752915f047aa303f0527b4 (patch)
treefb41265357e4785d049089c32299cc6201cf1d7b /dvbdevice.c
parente3aaeccee359534552af66cac247678d81539772 (diff)
downloadvdr-bff56bb85073ee25a1752915f047aa303f0527b4.tar.gz
vdr-bff56bb85073ee25a1752915f047aa303f0527b4.tar.bz2
Frequency for DVB-C and DVB-T is now in MHz, kHz or Hz
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index fc2e12ba..184720a1 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -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());