]> git.sesse.net Git - nageru/blobdiff - main.cpp
Make sure no frames are lost in storage on shutdown.
[nageru] / main.cpp
index b39208fab53630eda018d94201d19ce94d366596..f28b859fd842bdc501d238eccc743bf6667b5545 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1,3 +1,8 @@
+extern "C" {
+#include <libavformat/avformat.h>
+}
+#include <stdbool.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <epoxy/gl.h>
 
@@ -8,6 +13,7 @@
 #include <QSurfaceFormat>
 
 #include "context.h"
+#include "flags.h"
 #include "mainwindow.h"
 #include "mixer.h"
 
@@ -16,6 +22,7 @@ int main(int argc, char *argv[])
        setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 0);
        setlinebuf(stdout);
        av_register_all();
+       parse_flags(argc, argv);
 
        QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
        QApplication app(argc, argv);
@@ -33,11 +40,14 @@ int main(int argc, char *argv[])
        global_share_widget = new QGLWidget();
 
        MainWindow mainWindow;
-       mainWindow.resize(QSize(1500, 606));
+       mainWindow.resize(QSize(1500, 810));
        mainWindow.show();
 
+       app.installEventFilter(&mainWindow);  // For white balance color picking.
+
        int rc = app.exec();
        global_mixer->quit();
+       mainWindow.mixer_shutting_down();
        delete global_mixer;
        return rc;
 }