diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-15 00:41:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-28 00:33:55 +0200 |
| commit | b4ab6bdd6d988079280f4af6ea4fc344f62e61b8 (patch) | |
| tree | 2b3d4c8782aefb6239b2e89b917190ef65835c61 | |
| parent | bc8d283f90d51480c0ee5d40d6c9dcde420d8222 (diff) | |
Remove unnecessary method firstLaunch() which always returned true when true was passed into it.
| -rw-r--r-- | src/lib/grok/context.h | 47 | ||||
| -rw-r--r-- | src/lib/grok/messenger.h | 20 |
2 files changed, 26 insertions, 41 deletions
diff --git a/src/lib/grok/context.h b/src/lib/grok/context.h index 17d0a9238..1f62b5199 100644 --- a/src/lib/grok/context.h +++ b/src/lib/grok/context.h @@ -210,32 +210,29 @@ public: return false; } - if (MessengerInit::firstLaunch(true)) { - - if (!fs::exists(_dcpomatic_context->location) || !fs::is_directory(_dcpomatic_context->location)) { - getMessengerLogger()->error("Invalid directory %s", _dcpomatic_context->location.c_str()); - return false; - } + if (!fs::exists(_dcpomatic_context->location) || !fs::is_directory(_dcpomatic_context->location)) { + getMessengerLogger()->error("Invalid directory %s", _dcpomatic_context->location.c_str()); + return false; + } - auto s = dcpv.get_size(); - _dcpomatic_context->set_dimensions(s.width, s.height); - auto grok = Config::instance()->grok(); - if (!_messenger->launch_grok( - _dcpomatic_context->location, - _dcpomatic_context->width, - _dcpomatic_context->width, - _dcpomatic_context->height, - 3, - 12, - device, - _dcpomatic_context->film->resolution() == Resolution::FOUR_K, - _dcpomatic_context->film->video_frame_rate(), - _dcpomatic_context->film->video_bit_rate(VideoEncoding::JPEG2000), - grok.licence_server, - grok.licence)) { - _launch_failed = true; - return false; - } + auto s = dcpv.get_size(); + _dcpomatic_context->set_dimensions(s.width, s.height); + auto grok = Config::instance()->grok(); + if (!_messenger->launch_grok( + _dcpomatic_context->location, + _dcpomatic_context->width, + _dcpomatic_context->width, + _dcpomatic_context->height, + 3, + 12, + device, + _dcpomatic_context->film->resolution() == Resolution::FOUR_K, + _dcpomatic_context->film->video_frame_rate(), + _dcpomatic_context->film->video_bit_rate(VideoEncoding::JPEG2000), + grok.licence_server, + grok.licence)) { + _launch_failed = true; + return false; } _launched = _messenger->waitForClientInit(); diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h index cdde6fd51..e2553c425 100644 --- a/src/lib/grok/messenger.h +++ b/src/lib/grok/messenger.h @@ -148,9 +148,7 @@ struct MessengerInit , compressedFrameSize_(0) , numFrames_(0) { - if (firstLaunch(true)) { - unlink(); - } + unlink(); } void unlink() @@ -161,12 +159,6 @@ struct MessengerInit #endif } - static bool firstLaunch(bool isClient) - { - bool debugGrok = false; - return debugGrok != isClient; - } - std::string outboundMessageBuf; std::string outboundSentSynch; std::string outboundReceiveReadySynch; @@ -198,15 +190,13 @@ struct Synch : sentSemName_(sentSemName), receiveReadySemName_(receiveReadySemName) { // unlink semaphores in case of previous crash - if(MessengerInit::firstLaunch(true)) - unlink(); + unlink(); open(); } ~Synch() { close(); - if(MessengerInit::firstLaunch(true)) - unlink(); + unlink(); } void post(SynchDirection dir) { @@ -564,9 +554,7 @@ struct Messenger if (async_result_.valid()) { return true; } - if (MessengerInit::firstLaunch(true)) { - init_.unlink(); - } + init_.unlink(); startThreads(); char cmd[4096]; snprintf(cmd, sizeof(cmd), |
