X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fmjpeg_encoder.cpp;fp=nageru%2Fmjpeg_encoder.cpp;h=a60f729158925381435b1a4a495a201cd459bac6;hb=2dc38f684491f30639665a02e538f9a1e32d77ee;hp=26eb9a868f70ddeb6bbf23349318f7435d73565e;hpb=ecaec75dd52d076ba53cafa1fed716ebc0d93da6;p=nageru diff --git a/nageru/mjpeg_encoder.cpp b/nageru/mjpeg_encoder.cpp index 26eb9a8..a60f729 100644 --- a/nageru/mjpeg_encoder.cpp +++ b/nageru/mjpeg_encoder.cpp @@ -234,10 +234,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); }