Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/encode.moon
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ find_path = (startTime, endTime) ->
if is_stream
if mp.get_property('file-format') == 'hls'
-- Attempt to dump the stream cache into a temporary file
path = utils.join_path(parse_directory('~'), 'cache_dump.ts')
path = get_temp_path('.ts')
mp.command_native({
'dump_cache',
seconds_to_time_string(startTime, false, true),
Expand Down Expand Up @@ -445,4 +445,4 @@ encode = (region, startTime, endTime) ->
-- Clean up pass log file.
os.remove(get_pass_logfile_path(out_path))
if is_temporary
os.remove(path)
cleanup_temp_file(path)
5 changes: 5 additions & 0 deletions src/main.moon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ mainPage = MainPage!
mp.add_key_binding(options.keybind, "display-webm-encoder", mainPage\show, {repeatable: false})
mp.register_event("file-loaded", mainPage\setupStartAndEndTimes)

mp.register_event "shutdown", ->
for path, _ in pairs temp_files_to_clean
msg.verbose "Cleaning up temporary file: #{path}"
os.remove path

msg.verbose("Loaded mpv-webm script!")
emit_event("script-loaded")
Loading
Loading