From 7501f1846bcf184a41e9ee0750d60424e690e258 Mon Sep 17 00:00:00 2001 From: gdzhu Date: Thu, 26 Aug 2021 05:40:58 +0100 Subject: [PATCH] skip overlay processing when no overlay is specified --- src/main.cpp | 7 ++++++- src/mainwindow.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index accc571..bee35bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -138,9 +138,14 @@ int main(int argc, char *argv[]) std::cout << "Rotation Time: " << rotationSeconds << std::endl; std::cout << "Overlay input: " << overlay << std::endl; } + Overlay o(overlay); o.setDebugMode(debugMode); - w.setOverlay(&o); + if (!overlay.empty()) + { + w.setOverlay(&o); + } + w.setAspect(aspect); w.setDebugMode(debugMode); w.setFitAspectAxisToWindow(fitAspectAxisToWindow); diff --git a/src/mainwindow.h b/src/mainwindow.h index 42eaa04..1ee9a94 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -39,7 +39,7 @@ private: bool debugMode = false; bool fitAspectAxisToWindow = false; - Overlay* overlay; + Overlay* overlay = NULL; void drawText(QPixmap& image, int margin, int fontsize, QString text, int alignment);