diff options
author | wm4 <wm4@nowhere> | 2016-09-25 01:00:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-25 01:00:20 +0200 |
commit | cad6fb038b477865581109ab99dc79ad4b50e79f (patch) | |
tree | e98dd5872da811746b4f8416c7c148f8892279ff /player | |
parent | 733218b2331bfcf0d91be62418ab63a217e1108e (diff) | |
download | mpv-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.
Diffstat (limited to 'player')
-rw-r--r-- | player/lua.c | 4 |
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"; |