summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/pipeline/virtual/virtual.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp
index e692a543..469f5655 100644
--- a/src/libcamera/pipeline/virtual/virtual.cpp
+++ b/src/libcamera/pipeline/virtual/virtual.cpp
@@ -329,10 +329,17 @@ bool PipelineHandlerVirtual::match([[maybe_unused]] DeviceEnumerator *enumerator
created_ = true;
- File file(configurationFile("virtual", "virtual.yaml"));
- bool isOpen = file.open(File::OpenModeFlag::ReadOnly);
- if (!isOpen) {
- LOG(Virtual, Error) << "Failed to open config file: " << file.fileName();
+ std::string configFile = configurationFile("virtual", "virtual.yaml", true);
+ if (configFile.empty()) {
+ LOG(Virtual, Debug)
+ << "Configuration file not found, skipping virtual cameras";
+ return false;
+ }
+
+ File file(configFile);
+ if (!file.open(File::OpenModeFlag::ReadOnly)) {
+ LOG(Virtual, Error)
+ << "Failed to open config file `" << file.fileName() << "`";
return false;
}