From e155ff3a4230d8c934fbbe45c8936218c31b7c40 Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Sat, 19 Jul 2003 09:42:42 +0000 Subject: [lcd4linux @ 2003-07-19 09:42:42 by reinelt] check for dvb/frontend.h and disable DVB client if not found. --- dvb.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'dvb.c') diff --git a/dvb.c b/dvb.c index be01168..53bf8d7 100644 --- a/dvb.c +++ b/dvb.c @@ -41,6 +41,30 @@ #include #include #include + +#ifndef HAVE_LINUX_DVB_FRONTEND_H + +#warning linux/dvb/frontend.h not found. +#warning DVB client will be disabled. + +int DVB (double *strength, double *snr) +{ + static int flag=0; + + if (flag==0) { + error("lcd4linux has been compiled without DVB support"); + error("DVB client will be disabled"); + flag=1; + } + + *strength=0.0; + *snr=0.0; + + return 0; +} + +#else + #include #include "debug.h" @@ -79,20 +103,21 @@ int DVB (double *strength, double *snr) fd=-1; return -1; } - + if (ioctl(fd, FE_READ_SNR, &raw_snr)) { error("ioctl(FE_READ_SNR) failed: %s", strerror(errno)); fd=-1; return -1; } - + // Normalize to 1.0 strength0=raw_strength/65535.0; snr0=raw_snr/65535.0; - + *strength=strength0; *snr=snr0; return 0; } +#endif -- cgit v1.2.3