summaryrefslogtreecommitdiffstats
path: root/player/lua/defaults.lua
diff options
context:
space:
mode:
authortorque <torque@1>2015-03-06 03:20:57 -0800
committerwm4 <wm4@nowhere>2015-03-06 12:28:20 +0100
commit4ff29f33b0d86888a02524df5d6085c4bc29477e (patch)
treeb974a76983e69f6ae9fdb1e17d3ad7baa04a2f22 /player/lua/defaults.lua
parentfc571e0adb2498cc9278ee51f9aa6b00ee165644 (diff)
downloadmpv-4ff29f33b0d86888a02524df5d6085c4bc29477e.tar.bz2
mpv-4ff29f33b0d86888a02524df5d6085c4bc29477e.tar.xz
Lua: add unpack shim for Lua 5.2/5.3 compatibility.
The global unpack function got moved to table.unpack in Lua 5.2, and it's only available as the global if 5.2 is built with compatibility enabled (the default). Lua 5.3 does not build with 5.1 compatibility by default. Fixes #1648.
Diffstat (limited to 'player/lua/defaults.lua')
-rw-r--r--player/lua/defaults.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua
index 4cdeef497f..3a55e3a206 100644
--- a/player/lua/defaults.lua
+++ b/player/lua/defaults.lua
@@ -1,3 +1,5 @@
+-- Compatibility shim for lua 5.2/5.3
+unpack = unpack or table.unpack
-- these are used internally by lua.c
mp.UNKNOWN_TYPE.info = "this value is inserted if the C type is not supported"