summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2025-02-11 18:59:45 +0100
committersfan5 <sfan5@live.de>2025-02-11 19:19:36 +0100
commitbfa3e9086719b594bb738a542ef2bc7956afaf37 (patch)
tree687d408af0e5fbc8cb387a93514ead7544058c74
parentf385a6b25313c1d018f58523654c6b2313a72911 (diff)
downloadmpv-bfa3e9086719b594bb738a542ef2bc7956afaf37.tar.bz2
mpv-bfa3e9086719b594bb738a542ef2bc7956afaf37.tar.xz
video/out/android: don't assert-fail if WinID is not set
This matches the behavior of every other GPU context and is the only behavior that makes sense.
-rw-r--r--video/out/android_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/android_common.c b/video/out/android_common.c
index 27e7b5bb5b..6b9ef67db1 100644
--- a/video/out/android_common.c
+++ b/video/out/android_common.c
@@ -44,7 +44,10 @@ bool vo_android_init(struct vo *vo)
goto fail;
}
- assert(vo->opts->WinID != 0 && vo->opts->WinID != -1);
+ if (vo->opts->WinID == 0 || vo->opts->WinID == -1) {
+ MP_FATAL(ctx, "Missing surface pointer\n");
+ goto fail;
+ }
jobject surface = (jobject)(intptr_t)vo->opts->WinID;
ctx->native_window = ANativeWindow_fromSurface(env, surface);
if (!ctx->native_window) {