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
This commit is contained in:
rnhmjoj 2021-03-08 09:46:18 +01:00 committed by avih
parent aac1844179
commit 45e6804478
1 changed files with 1 additions and 1 deletions

View File

@ -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