Skip to content

Commit c961c96

Browse files
guidocellaDudemanguy
authored andcommitted
lua: remove the deprecated error field from end-file
This has been deprecated for 6 years so remove the compatibility code. This basically reverts 37f441d.
1 parent 70b8b22 commit c961c96

4 files changed

Lines changed: 5 additions & 17 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
remove the deprecated `error` field from `end-file`

DOCS/man/input.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,8 +1829,7 @@ This list uses the event name field value, and the C API symbol in brackets:
18291829
Playback was ended by sending the quit command.
18301830

18311831
``error``
1832-
An error happened. In this case, an ``error`` field is present with
1833-
the error string.
1832+
An error happened.
18341833

18351834
``redirect``
18361835
Happens with playlists and similar. Details see
@@ -1849,10 +1848,7 @@ This list uses the event name field value, and the C API symbol in brackets:
18491848

18501849
``file_error``
18511850
Set to mpv error string describing the approximate reason why playback
1852-
failed. Unset if no error known. (In Lua scripting, this value was set
1853-
on the ``error`` field directly. This is deprecated since mpv 0.33.0.
1854-
In the future, this ``error`` field will be unset for this specific
1855-
event.)
1851+
failed. Unset if no error known.
18561852

18571853
``playlist_insert_id``
18581854
If loading ended, because the playlist entry to be played was for example

player/lua.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static int script_get_script_directory(lua_State *L)
558558

559559
static void pushnode(lua_State *L, mpv_node *node);
560560

561-
static int script_raw_wait_event(lua_State *L, void *tmp)
561+
static int script_wait_event(lua_State *L, void *tmp)
562562
{
563563
struct script_ctx *ctx = get_ctx(L);
564564

@@ -1226,7 +1226,7 @@ struct fn_entry {
12261226

12271227
static const struct fn_entry main_fns[] = {
12281228
FN_ENTRY(log),
1229-
AF_ENTRY(raw_wait_event),
1229+
AF_ENTRY(wait_event),
12301230
FN_ENTRY(request_event),
12311231
FN_ENTRY(find_config_file),
12321232
FN_ENTRY(get_script_directory),

player/lua/defaults.lua

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,15 +502,6 @@ _G.print = mp.msg.info
502502
package.loaded["mp"] = mp
503503
package.loaded["mp.msg"] = mp.msg
504504

505-
function mp.wait_event(t)
506-
local r = mp.raw_wait_event(t)
507-
if r and r.file_error and not r.error then
508-
-- compat; deprecated
509-
r.error = r.file_error
510-
end
511-
return r
512-
end
513-
514505
_G.mp_event_loop = function()
515506
mp.dispatch_events(true)
516507
end

0 commit comments

Comments
 (0)