From: Carl Hetherington Date: Tue, 26 Sep 2023 18:59:39 +0000 (+0200) Subject: Cleanup: coding style. X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=a35a5a3508f98473aaffe37b54c1aa9c3f9eb4db;p=dcpomatic.git Cleanup: coding style. --- diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h index 50d44e251..bb7ada213 100644 --- a/src/lib/grok/messenger.h +++ b/src/lib/grok/messenger.h @@ -758,6 +758,7 @@ struct Msg std::vector cs_; size_t ct_; }; + static void processorThread(Messenger* messenger, std::function processor) { while (messenger->running) { @@ -765,31 +766,26 @@ static void processorThread(Messenger* messenger, std::functionreceiveQueue.waitAndPop(message)) { break; } - if(!messenger->running) + + if (!messenger->running) { break; + } + Msg msg(message); auto tag = msg.next(); - if(tag == GRK_MSGR_BATCH_COMPRESS_INIT) - { + if (tag == GRK_MSGR_BATCH_COMPRESS_INIT) { auto width = msg.nextUint(); - auto stride = msg.nextUint(); - (void)stride; + msg.nextUint(); // stride auto height = msg.nextUint(); - auto samplesPerPixel = msg.nextUint(); - auto depth = msg.nextUint(); - (void)depth; - messenger->init_.uncompressedFrameSize_ = - Messenger::uncompressedFrameSize(width, height, samplesPerPixel); - auto compressedFrameSize = msg.nextUint(); - auto numFrames = msg.nextUint(); - messenger->initClient(compressedFrameSize, compressedFrameSize, numFrames); - } - else if(tag == GRK_MSGR_BATCH_PROCESSED_UNCOMPRESSED) - { + auto samples_per_pixel = msg.nextUint(); + msg.nextUint(); // depth + messenger->init_.uncompressedFrameSize_ = Messenger::uncompressedFrameSize(width, height, samples_per_pixel); + auto compressed_frame_size = msg.nextUint(); + auto num_frames = msg.nextUint(); + messenger->initClient(compressed_frame_size, compressed_frame_size, num_frames); + } else if (tag == GRK_MSGR_BATCH_PROCESSED_UNCOMPRESSED) { messenger->reclaimUncompressed(msg.nextUint()); - } - else if(tag == GRK_MSGR_BATCH_PROCESSSED_COMPRESSED) - { + } else if (tag == GRK_MSGR_BATCH_PROCESSSED_COMPRESSED) { messenger->reclaimCompressed(msg.nextUint()); } processor(message);