]> git.sesse.net Git - nageru/blobdiff - nageru/mjpeg_encoder.cpp
Fix compilation break with SVT-AV1.
[nageru] / nageru / mjpeg_encoder.cpp
index 26eb9a868f70ddeb6bbf23349318f7435d73565e..193027b38483e42359f9733a3d899dcad0b4f8db 100644 (file)
@@ -10,6 +10,7 @@
 
 extern "C" {
 #include <libavformat/avformat.h>
+#include <libavutil/channel_layout.h>
 }
 
 #include "defs.h"
@@ -234,10 +235,9 @@ MJPEGEncoder::MJPEGEncoder(HTTPD *httpd, const string &va_display)
                fprintf(stderr, "Could not initialize VA-API for MJPEG encoding: %s. JPEGs will be encoded in software if needed.\n", error.c_str());
        }
 
-       va_pool.reset(new VAResourcePool(va_dpy->va_dpy, uyvy_format, nv12_format, config_id_422, config_id_420, /*with_data_buffer=*/true));
-
        encoder_thread = thread(&MJPEGEncoder::encoder_thread_func, this);
        if (va_dpy != nullptr) {
+               va_pool.reset(new VAResourcePool(va_dpy->va_dpy, uyvy_format, nv12_format, config_id_422, config_id_420, /*with_data_buffer=*/true));
                va_receiver_thread = thread(&MJPEGEncoder::va_receiver_thread_func, this);
        }