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:
parent
50e1d17615
commit
0a467085d2
2 changed files with 9 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue