Skip to content

Display and control your Android device

Force EGL only if VA-API is enabled

Romain Vimont066173c411a0
diff --git a/app/src/sdl_hints.c b/app/src/sdl_hints.c
index 83173b14..f90dc012 100644
--- a/app/src/sdl_hints.c
+++ b/app/src/sdl_hints.c
@@ -44,15 +44,18 @@ sc_sdl_set_hints(const char *render_driver, bool disable_screensaver) {
LOGW("Could not enable screensaver");
}
+#ifdef HAVE_VAAPI
// On X11, SDL creates the OpenGL contexts with GLX by default, but
// importing hardware decoded frames (VA-API) requires EGL. Always use EGL,
- // so that the rendering does not depend on the hardware decoding mode. It
- // has no effect on other platforms.
+ // so that the rendering does not depend on the hardware decoding mode.
+ // Do not force it on other platforms: on Windows and macOS, it would try to
+ // load libEGL.dll.
// The environment variable SDL_VIDEO_FORCE_EGL=0 takes priority to restore
// GLX (hardware decoding is then unavailable).
if (!SDL_SetHint(SDL_HINT_VIDEO_FORCE_EGL, "1")) {
LOGW("Could not force EGL");
}
+#endif
// On Windows, SDL creates the Direct3D 11 device single-threaded by
// default, but hardware decoding (D3D11VA) uses it from the decoder thread.