summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-25 01:00:20 +0200
committerwm4 <wm4@nowhere>2016-09-25 01:00:20 +0200
commitcad6fb038b477865581109ab99dc79ad4b50e79f (patch)
treee98dd5872da811746b4f8416c7c148f8892279ff
parent733218b2331bfcf0d91be62418ab63a217e1108e (diff)
downloadmpv-cad6fb038b477865581109ab99dc79ad4b50e79f.tar.bz2
mpv-cad6fb038b477865581109ab99dc79ad4b50e79f.tar.xz
lua: complain loudly if Lua state creation fails
This should normally happen only if memory allocation for the state happens, which should be extremely rare. But with Luajit on OSX, it can happen if the magic compiler flags required by Luajit were not passed to mpv compilation. Print an error to reduce confusion.
-rw-r--r--player/lua.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/lua.c b/player/lua.c
index 1ad6bff682..442a2ba073 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -377,8 +377,10 @@ static int load_lua(struct mpv_handle *client, const char *fname)
}
lua_State *L = ctx->state = luaL_newstate();
- if (!L)
+ if (!L) {
+ MP_FATAL(ctx, "Could not initialize Lua.\n");
goto error_out;
+ }
if (mp_cpcall(L, run_lua, ctx)) {
const char *err = "unknown error";