mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-20 05:01:51 -04:00
UI: Set 8x8 as minimum selectable resolution
Since libobs internally rounds to various powers of 2 to support SSE functions, resolutions that are too low can get rounded to zero. libobs will fail to startup with a zero resolution, so if a user accidentally entered anything that rounded to zero OBS would become unusable without manual fixing by editing the profile .ini.
This commit is contained in:
1 parent
50e1d17615
commit
0a467085d2
2 files changed
+9
-4
No files matched your search
@@ -103,6 +103,11 @@ static inline bool ResTooHigh(uint32_t cx, uint32_t cy)
|
||||
return cx > 16384 || cy > 16384;
|
||||
}
|
||||
|
||||
static inline bool ResTooLow(uint32_t cx, uint32_t cy)
|
||||
{
|
||||
return cx < 8 || cy < 8;
|
||||
}
|
||||
|
||||
/* parses "[width]x[height]", string, i.e. 1024x768 */
|
||||
static bool ConvertResText(const char *res, uint32_t &cx, uint32_t &cy)
|
||||
{
|
||||
@@ -137,7 +142,7 @@ static bool ConvertResText(const char *res, uint32_t &cx, uint32_t &cy)
|
||||
if (lexer_getbasetoken(lex, &token, IGNORE_WHITESPACE))
|
||||
return false;
|
||||
|
||||
if (ResTooHigh(cx, cy)) {
|
||||
if (ResTooHigh(cx, cy) || ResTooLow(cx, cy)) {
|
||||
cx = cy = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user