From 61f4a898006dade56233c4d6d8f1bc77024d789b Mon Sep 17 00:00:00 2001 From: Risto Avila Date: Sun, 10 Feb 2019 22:14:07 +0200 Subject: [PATCH 1/1] Add version check before using newer dvb5 api's, fixes compile against older kernels like 3.2.x --- streamer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 streamer.c diff --git a/streamer.c b/streamer.c old mode 100644 new mode 100755 index 7419692..074aba5 --- a/streamer.c +++ b/streamer.c @@ -26,6 +26,7 @@ #include #include #include +#include // work-around for VDR's tools.h #if VDRVERSNUM < 20400 @@ -534,6 +535,7 @@ void cLiveStreamer::sendStreamChange() m_Socket->write(resp.getPtr(), resp.getLen()); } +#if DVB_API_VERSION >= 5 && DVB_API_VERSION_MINOR >= 10 // taken from vdr 2.3.4+ keeping the comments static uint16_t dB1000toRelative(__s64 dB1000, int Low, int High) { @@ -553,6 +555,7 @@ static uint16_t dB1000toRelative(__s64 dB1000, int Low, int High) return 0; return (uint16_t)(0xffff - dB1000); } +#endif void cLiveStreamer::sendSignalInfo() { @@ -657,6 +660,7 @@ void cLiveStreamer::sendSignalInfo() ioctl(m_Frontend, FE_READ_STATUS, &status); bool signal_needed(true), snr_needed(true), ber_needed(true), unc_needed(true); +#if DVB_API_VERSION >= 5 && DVB_API_VERSION_MINOR >= 10 dtv_property fe_props[4]; dtv_properties fe_cmd; memset(&fe_props, 0, sizeof(fe_props)); @@ -733,7 +737,7 @@ void cLiveStreamer::sendSignalInfo() } } } - +#endif if (signal_needed && ioctl(m_Frontend, FE_READ_SIGNAL_STRENGTH, &fe_signal) == -1) fe_signal = -2; if (snr_needed && ioctl(m_Frontend, FE_READ_SNR, &fe_snr) == -1) -- 1.7.10.4