summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-15 09:00:18 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-15 21:07:13 +0300
commitc647516278f5624174b3152b77e2565e502bbb73 (patch)
treef77ec5b879d24ae3580c2de4b3a6fa35f9d63c5c
parent987eecdb5a7503a6bfe14c6be3a1b16707c37e7f (diff)
downloadmpv-c647516278f5624174b3152b77e2565e502bbb73.tar.bz2
mpv-c647516278f5624174b3152b77e2565e502bbb73.tar.xz
ytdl_hook: don't log error when loading is aborted
-rw-r--r--player/lua/ytdl_hook.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 8bf088fe5f..91e1a732bd 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -31,7 +31,7 @@ local safe_protos = Set {
local function exec(args)
local ret = utils.subprocess({args = args})
- return ret.status, ret.stdout, ret
+ return ret.status, ret.stdout, ret, ret.killed_by_us
end
-- return true if it was explicitly set on the command line
@@ -502,7 +502,11 @@ mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function ()
table.insert(command, "--")
table.insert(command, url)
msg.debug("Running: " .. table.concat(command,' '))
- local es, json, result = exec(command)
+ local es, json, result, aborted = exec(command)
+
+ if aborted then
+ return
+ end
if (es < 0) or (json == nil) or (json == "") then
local err = "youtube-dl failed: "