diff options
author | wm4 <wm4@nowhere> | 2015-06-11 21:41:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-11 21:42:09 +0200 |
commit | 0d2456ae5f0440bbea357d7463618fa8bd41ca88 (patch) | |
tree | 3a2fbae530ffc4668ef521e8cc65e90a1f5611cf | |
parent | e53cb0890e8071ca86271c8b100343944dbbefe7 (diff) |
lua: support MPV_END_FILE_REASON_REDIRECT
And also add the missing "unknown" entry to the manpage.
-rw-r--r-- | DOCS/man/lua.rst | 10 | ||||
-rw-r--r-- | player/lua.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 4d3fb7c3d8..64775d0d74 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -707,6 +707,16 @@ List of events An error happened. In this case, an ``error`` field is present with the error string. + ``redirect`` + Happens with playlists and similar. Details see + ``MPV_END_FILE_REASON_REDIRECT`` in the C API. + + ``unknown`` + Unknown. Normally doesn't happen, unless the Lua API is out of sync + with the C API. (Likewise, it could happen that your script gets + reason strings that did not exist yet at the time your script was + written.) + ``file-loaded`` Happens after a file was loaded and begins playback. diff --git a/player/lua.c b/player/lua.c index 7f4e2405de..f640b654cf 100644 --- a/player/lua.c +++ b/player/lua.c @@ -520,6 +520,7 @@ static int script_wait_event(lua_State *L) case MPV_END_FILE_REASON_STOP: reason = "stop"; break; case MPV_END_FILE_REASON_QUIT: reason = "quit"; break; case MPV_END_FILE_REASON_ERROR: reason = "error"; break; + case MPV_END_FILE_REASON_REDIRECT: reason = "redirect"; break; default: reason = "unknown"; } |