From add8d8e8db8b4b3a4f6391ea16fdf46e88065d00 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 26 Sep 2020 22:17:02 +0000 Subject: [PATCH] server: Move pixel format conversion out of do_client_update_fb --- src/server.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server.c b/src/server.c index c97b5fd..a3d9939 100644 --- a/src/server.c +++ b/src/server.c @@ -509,6 +509,11 @@ static void process_fb_update_requests(struct nvnc_client* client) struct nvnc_fb* fb = client->server->display->buffer; assert(fb); + if (!client->has_pixfmt) { + rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format); + client->has_pixfmt = true; + } + if (fb->width != client->known_width || fb->height != client->known_height) send_desktop_resize(client, fb); @@ -1107,11 +1112,6 @@ static void do_client_update_fb(void* work) enum rfb_encodings encoding = choose_frame_encoding(client); - if (!client->has_pixfmt) { - rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format); - client->has_pixfmt = true; - } - switch (encoding) { case RFB_ENCODING_RAW: raw_encode_frame(&update->frame, &client->pixfmt, fb,