From 11289d52389f83edf9358fb3b93bb1bca32dc51c Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Thu, 3 May 2018 01:40:24 +0100 Subject: 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. --- player/lua/ytdl_hook.lua | 8 ++++---- 1 file 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 -- cgit v1.2.3