summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/converter.cpp4
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp
index 3de39cff..fa0f1ec8 100644
--- a/src/libcamera/converter.cpp
+++ b/src/libcamera/converter.cpp
@@ -227,7 +227,9 @@ std::unique_ptr<Converter> ConverterFactoryBase::create(MediaDevice *media)
<< factory->name_ << " factory with "
<< (it == compatibles.end() ? "no" : media->driver()) << " alias.";
- return factory->createInstance(media);
+ std::unique_ptr<Converter> converter = factory->createInstance(media);
+ if (converter->isValid())
+ return converter;
}
return nullptr;
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 24ded4db..2423ec10 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -493,7 +493,7 @@ int SimpleCameraData::init()
MediaDevice *converter = pipe->converter();
if (converter) {
converter_ = ConverterFactoryBase::create(converter);
- if (!converter_->isValid()) {
+ if (!converter_) {
LOG(SimplePipeline, Warning)
<< "Failed to create converter, disabling format conversion";
converter_.reset();