From 4761d15f7b51c8cabb955051ccbb5b85fe2141c5 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Feb 2017 12:09:47 +0100 Subject: [PATCH] add --enable-fastscan configure option The #define in src/gui/scan_setup.h did not work (undefining ENABLE_FASTSCAN caused really strange side effects wrt background scanning in standby mode), and all the unused code was still built. With this configure option, people who really want this obscure feature can enable it for their builds. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6525d1164a98e57c9aa9bebcd5daa29a6c646eec Author: Stefan Seyfried Date: 2017-02-04 (Sat, 04 Feb 2017) ------------------ This commit was generated by Migit --- configure.ac | 6 ++++++ src/gui/scan.cpp | 11 ++++++++++- src/gui/scan_setup.h | 2 -- src/neutrino.cpp | 8 +++++++- src/zapit/include/zapit/scan.h | 5 ++++- src/zapit/src/Makefile.am | 6 +++++- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f230f451a..122c42dce 100644 --- a/configure.ac +++ b/configure.ac @@ -165,6 +165,12 @@ AC_ARG_ENABLE(viasatepg, [ --enable-viasatepg enable ViaSat EPG code (experimental)], [AC_DEFINE(ENABLE_VIASATEPG,1,[enable ViaSat EPG code])]) +AC_ARG_ENABLE(fastscan, + [ --enable-fastscan enable Fastscan code)], + [AC_DEFINE(ENABLE_FASTSCAN,1,[enable fastscan code])]) + +AM_CONDITIONAL(ENABLE_FASTSCAN, test "$enable_fastscan" = "yes") + AC_ARG_ENABLE(giflib, AS_HELP_STRING(--enable-giflib,use giflib instead of libungif), ,[enable_giflib=no]) diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index e921e53eb..0b917b1c4 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -2,7 +2,7 @@ Neutrino-GUI - DBoxII-Project Copyright (C) 2001 Steffen Hehn 'McClean' - Copyright (C) 2011-2012 Stefan Seyfried + Copyright (C) 2011-2013,2015,2017 Stefan Seyfried License: GPL @@ -169,6 +169,13 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) bool test = actionKey == "test"; bool manual = (actionKey == "manual") || test; bool fast = (actionKey == "fast"); +#if !ENABLE_FASTSCAN + if (fast) { + /* popup message? But this *should* be impossible to happen anyway */ + fprintf(stderr, "CScanTs::exec: fastscan disabled at build-time!\n"); + return menu_return::RETURN_REPAINT; + } +#endif if (CFrontend::isSat(delsys)) pname = scansettings.satName; @@ -299,8 +306,10 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) } else if(manual) success = g_Zapit->scan_TP(TP); else if(fast) { +#if ENABLE_FASTSCAN CServiceScan::getInstance()->QuietFastScan(false); success = CZapit::getInstance()->StartFastScan(scansettings.fast_type, scansettings.fast_op); +#endif } else success = g_Zapit->startScan(scan_flags); diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index f7110ccb9..f281de2f3 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -42,8 +42,6 @@ #define scansettings CNeutrinoApp::getInstance()->getScanSettings() -//#define ENABLE_FASTSCAN //don't define this to remove fast scan menu - class CScanSetup : public CMenuTarget, public CChangeObserver { protected: diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1798b1631..06c766e04 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4,7 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' and some other guys - Copyright (C) 2006-2016 Stefan Seyfried + Copyright (C) 2006-2017 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd @@ -4852,6 +4852,7 @@ void CNeutrinoApp::Cleanup() #endif } +#if ENABLE_FASTSCAN void CNeutrinoApp::CheckFastScan(bool standby, bool reload) { if (scansettings.fst_update) { @@ -4883,6 +4884,11 @@ void CNeutrinoApp::CheckFastScan(bool standby, bool reload) } } } +#else +void CNeutrinoApp::CheckFastScan(bool, bool) +{ +} +#endif bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) { diff --git a/src/zapit/include/zapit/scan.h b/src/zapit/include/zapit/scan.h index 0a100bd97..cc117cddf 100644 --- a/src/zapit/include/zapit/scan.h +++ b/src/zapit/include/zapit/scan.h @@ -109,6 +109,7 @@ class CServiceScan : public OpenThreads::Thread uint32_t tune_tp_index; unsigned char fst_version; +#if ENABLE_FASTSCAN bool quiet_fastscan; void InitFastscanLnb(int id); bool FastscanTune(int id); @@ -120,7 +121,7 @@ class CServiceScan : public OpenThreads::Thread void process_satellite_delivery_system_descriptor(const unsigned char * const buffer, FrontendParameters * feparams, t_satellite_position * satellitePosition); bool ScanFast(); void ReportFastScan(FrontendParameters &feparams, t_satellite_position satellitePosition); - +#endif void run(); CFrontend * frontend; @@ -151,12 +152,14 @@ class CServiceScan : public OpenThreads::Thread bool isFtaOnly() { return flags & SCAN_FTA; } int GetFlags() { return flags; } bool SatHaveChannels() { return satHaveChannels; } +#if ENABLE_FASTSCAN /* fast-scan */ bool TestDiseqcConfig(int num); bool ReadFstVersion(int num); unsigned char GetFstVersion() { return fst_version; } void QuietFastScan(bool enable) { quiet_fastscan = enable; } bool ScanFast(int num, bool reload = true); +#endif }; #endif /* __scan_h__ */ diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index 0130f3a8a..af2c71f3c 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -20,7 +20,6 @@ libzapit_a_SOURCES = \ bouquets.cpp \ capmt.cpp \ channel.cpp \ - fastscan.cpp \ femanager.cpp \ frontend.cpp \ getservices.cpp \ @@ -33,6 +32,11 @@ libzapit_a_SOURCES = \ transponder.cpp \ zapit.cpp +if ENABLE_FASTSCAN +libzapit_a_SOURCES += \ + fastscan.cpp +endif + bin_PROGRAMS = pzapit sbin_PROGRAMS = udpstreampes