From 45e6804478c796c4f00fee26e1f152171effc241 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 8 Mar 2021 09:46:18 +0100 Subject: ytdl_hook: fix crash on missing track bitrate Some tracks happen to lack bitrate information (ie. no tbr value). In that case, just ignore the track while computing the max bitrate. For an example, this is a stream in which all audio tracks have no bitrate: https://www.raiplay.it/dirette/rai1 --- player/lua/ytdl_hook.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index e9a7b3aac7..586d4ea874 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -507,7 +507,7 @@ local function add_single_video(json) if requested_formats then for _, track in pairs(requested_formats) do - max_bitrate = track.tbr > max_bitrate and + max_bitrate = (track.tbr and track.tbr > max_bitrate) and track.tbr or max_bitrate end elseif json.tbr then -- cgit v1.2.3