diff options
Diffstat (limited to 'src/layer_context.cc')
| -rw-r--r-- | src/layer_context.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/layer_context.cc b/src/layer_context.cc index 28a94b5..4699202 100644 --- a/src/layer_context.cc +++ b/src/layer_context.cc @@ -4,12 +4,15 @@ #include <string_view> namespace low_latency { - + LayerContext::LayerContext() { - this->is_antilag_1_enabled = []() -> auto { - const auto env = std::getenv(LayerContext::SLEEP_AFTER_PRESENT_ENV); + const auto parse_bool_env = [](const auto& name) -> bool { + const auto env = std::getenv(name); return env && std::string_view{env} == "1"; - }(); + }; + + this->is_antilag_1_enabled = parse_bool_env(SLEEP_AFTER_PRESENT_ENV); + this->should_spoof_nvidia = parse_bool_env(SPOOF_NVIDIA_ENV); } LayerContext::~LayerContext() {} |
