From 5ba091235fef86fda675021812eb7559241c1b80 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 16 Oct 2021 21:22:40 +0200 Subject: Allow setting video max height in config --- src/Config.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Config.cpp') diff --git a/src/Config.cpp b/src/Config.cpp index 146527a..f8dc3ed 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -52,6 +52,7 @@ namespace QuickMedia { if(config_initialized) return; + setlocale(LC_ALL, "C"); // Sigh... stupid C config_initialized = true; // Wtf? can't use static non-pointer config because it causes a segfault when setting config.theme. // It looks like a libc bug??? crashes for both gcc and clang. @@ -117,6 +118,13 @@ namespace QuickMedia { config->input.font_size = font_size_json.asDouble(); } + const Json::Value &video_json = json_root["video"]; + if(video_json.isObject()) { + const Json::Value &max_height_json = video_json["max_height"]; + if(max_height_json.isNumeric()) + config->video.max_height = max_height_json.asInt(); + } + const Json::Value &use_system_fonts_json = json_root["use_system_fonts"]; if(use_system_fonts_json.isBool()) config->use_system_fonts = use_system_fonts_json.asBool(); -- cgit v1.2.3