1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-04 14:12:10 +00:00
mpv/player
wm4 02ca42c7f1 lua: redo error handling, print backtraces
The original goal was just adding backtraces, however making the code
safe (especially wrt. to out of memory Lua errors) was hard. So this
commit also restructures error handling to make it conceptually simpler.
Now all Lua code is run inside a Lua error handling, except the calls
for creating and destroying the Lua context, and calling the wrapper C
function in a safe way.

The new error handling is actually conceptually simpler and more
correct, because you can just call any Lua function at initialization,
without having to worry whwther it throws errors or not.

Unfortunately, Lua 5.2 removes lua_cpcall(), so we have to emulate it.
There isn't any way to emulate it in a way that works the same on 5.1
and 5.2 with the same semantics in error cases, so ifdeffery is needed.
The debug.traceback() function also behaves weirdly differently between
the Lua versions, so its output is not as nice as it could be (empty
extra line).
2014-07-07 18:00:41 +02:00
..
lua player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
timeline demux: make start time a simple field 2014-07-05 17:07:15 +02:00
audio.c demux: make replaygain per-track 2014-07-05 17:07:14 +02:00
client.c client API: allow calling mpv_terminate_destroy(NULL) 2014-07-04 02:24:49 +02:00
client.h Add more const 2014-06-11 00:39:14 +02:00
command.c Remove stream_pts stuff 2014-07-06 19:05:59 +02:00
command.h command: redo the property type 2014-06-13 02:11:39 +02:00
configfiles.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
core.h command: change cache perentage to float, add cache-free and cache-used 2014-07-02 01:28:11 +02:00
discnav.c discnav: fix a comment 2014-07-05 17:07:15 +02:00
loadfile.c demux: minor simplification 2014-07-06 19:02:21 +02:00
lua.c lua: redo error handling, print backtraces 2014-07-07 18:00:41 +02:00
main_fn.c build: add option to build a library 2014-02-10 21:25:22 +01:00
main.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
misc.c demux: make start time a simple field 2014-07-05 17:07:15 +02:00
osd.c command: change cache perentage to float, add cache-free and cache-used 2014-07-02 01:28:11 +02:00
playloop.c Remove stream_pts stuff 2014-07-06 19:05:59 +02:00
screenshot.c player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
screenshot.h
scripting.c scripting: shorten a line 2014-06-26 19:56:45 +02:00
sub.c dvd, bluray, cdda: add demux_disc containing all related hacks 2014-07-05 17:07:15 +02:00
video.c dvd, bluray, cdda: add demux_disc containing all related hacks 2014-07-05 17:07:15 +02:00