1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-17 20:58:20 +00:00
This commit is contained in:
Nicolas F. 2025-04-09 20:01:59 -04:00 committed by GitHub
commit 2d65ae48b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -887,6 +887,18 @@ local function add_single_video(json)
stream_opts["cookies"] = serialize_cookies_for_avformat(existing_cookies)
end
local chunk_size = math.huge
if has_requested_formats then
for _, f in pairs(requested_formats) do
if f.downloader_options and f.downloader_options.http_chunk_size then
chunk_size = math.min(chunk_size, tonumber(f.downloader_options.http_chunk_size))
end
end
end
if chunk_size < math.huge then
stream_opts = append_libav_opt(stream_opts, "max_requested_size", tostring(chunk_size))
end
mp.set_property_native("file-local-options/stream-lavf-o", stream_opts)
end