diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2018-05-03 01:40:24 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-05-03 22:03:48 +0300 |
commit | 11289d52389f83edf9358fb3b93bb1bca32dc51c (patch) | |
tree | 60c17299f6b0ffed829dc5f655d31dcb8164ede2 | |
parent | 98b8e60b14921cf94eadb0adea5e9d7461091e96 (diff) | |
download | mpv-11289d52389f83edf9358fb3b93bb1bca32dc51c.tar.bz2 mpv-11289d52389f83edf9358fb3b93bb1bca32dc51c.tar.xz |
ytdl_hook: try to set video track first if available
Fixes `--ytdl-format="dash-fastly_skyfire-video-363357330+dash-fastly_skyfire_sep-audio-363357330" https://vimeo.com/108650530`
This happened because the video track also had audio available and after
adding it expecting an audio-only track, there were no more tracks with video.
-rw-r--r-- | player/lua/ytdl_hook.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 91e1a732bd..cd9b61adda 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -311,14 +311,14 @@ local function add_single_video(json) if not edl_track and not url_is_safe(track.url) then return end - if track.acodec and track.acodec ~= "none" then + if track.vcodec and track.vcodec ~= "none" then + -- video track + streamurl = edl_track or track.url + elseif track.acodec and track.acodec ~= "none" and track.vcodec == "none" then -- audio track mp.commandv("audio-add", edl_track or track.url, "auto", track.format_note or "") - elseif track.vcodec and track.vcodec ~= "none" then - -- video track - streamurl = edl_track or track.url end end |