mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 08:29:36 +00:00
ytdl_hook: fix clip start and end
This commit is contained in:
parent
b573a4967d
commit
c50f536bd1
@ -693,11 +693,21 @@ local function add_single_video(json)
|
||||
end
|
||||
|
||||
-- set start time
|
||||
if not (json.start_time == nil) and
|
||||
if (json.start_time or json.section_start) and
|
||||
not option_was_set("start") and
|
||||
not option_was_set_locally("start") then
|
||||
msg.debug("Setting start to: " .. json.start_time .. " secs")
|
||||
mp.set_property("file-local-options/start", json.start_time)
|
||||
local start_time = json.start_time or json.section_start
|
||||
msg.debug("Setting start to: " .. start_time .. " secs")
|
||||
mp.set_property("file-local-options/start", start_time)
|
||||
end
|
||||
|
||||
-- set end time
|
||||
if (json.end_time or json.section_end) and
|
||||
not option_was_set("end") and
|
||||
not option_was_set_locally("end") then
|
||||
local end_time = json.end_time or json.section_end
|
||||
msg.debug("Setting end to: " .. end_time .. " secs")
|
||||
mp.set_property("file-local-options/end", end_time)
|
||||
end
|
||||
|
||||
-- set aspect ratio for anamorphic video
|
||||
|
Loading…
Reference in New Issue
Block a user