From 90398bc04f37151c5aee61daafe46f0640cfb7a1 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 11 Mar 2024 12:46:02 +1100 Subject: [PATCH] [host] app: do not try to use deprecated interfaces automatically --- host/include/interface/capture.h | 2 ++ host/src/app.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/host/include/interface/capture.h b/host/include/interface/capture.h index 90196bbc1..e3e969b4d 100644 --- a/host/include/interface/capture.h +++ b/host/include/interface/capture.h @@ -112,6 +112,8 @@ typedef struct CaptureInterface { const char * shortName; const bool asyncCapture; + const bool deprecated; + const char * (*getName )(void); void (*initOptions )(void); diff --git a/host/src/app.c b/host/src/app.c index 19496dab3..b052c1a98 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -894,8 +894,18 @@ int app_main(int argc, char * argv[]) CaptureInterface * iface = NULL; for(int i = 0; CaptureInterfaces[i]; ++i) { - if (*ifaceName && strcasecmp(ifaceName, CaptureInterfaces[i]->shortName)) - continue; + if (*ifaceName) + { + if (strcasecmp(ifaceName, CaptureInterfaces[i]->shortName) != 0) + continue; + } + else + { + /* do not try to init deprecated interfaces unless they are explicity + selected in the host configuration */ + if (CaptureInterfaces[i]->deprecated) + continue; + } iface = CaptureInterfaces[i]; DEBUG_INFO("Trying : %s", iface->getName());