mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 16:40:12 +00:00
vdisp/sdl2: if [WAYLAND_]DISPLAY undef, use KMSDRM
If neither DISPLAY nor WAYLAND_DISPLAY environment variable is defined, set driver=KMSDRM by default in Linux.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2018-2023 CESNET, z. s. p. o.
|
||||
* Copyright (c) 2018-2024 CESNET
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -718,6 +718,15 @@ static void *display_sdl2_init(struct module *parent, const char *fmt, unsigned
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
if (driver == NULL && getenv("DISPLAY") == NULL &&
|
||||
getenv("WAYLAND_DISPLAY") == NULL) {
|
||||
MSG(NOTICE, "X11/Wayland doesn't seem to be running (according "
|
||||
"to env vars). Setting driver=KMSDRM.\n");
|
||||
driver = "KMSDRM";
|
||||
}
|
||||
#endif // defined __linux__
|
||||
|
||||
if (SDL_VideoInit(driver) < 0) {
|
||||
MSG(ERROR, "Unable to initialize SDL2 video: %s\n",
|
||||
SDL_GetError());
|
||||
|
||||
Reference in New Issue
Block a user