Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
36 lines (27 loc) · 1.04 KB

File metadata and controls

36 lines (27 loc) · 1.04 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- mpvSockets, one socket per instance, removes socket on exit
local utils = require 'mp.utils'
local function get_temp_path()
local directory_seperator = package.config:match("([^\n]*)\n?")
local example_temp_file_path = os.tmpname()
-- remove generated temp file
pcall(os.remove, example_temp_file_path)
local seperator_idx = example_temp_file_path:reverse():find(directory_seperator)
local temp_path_length = #example_temp_file_path - seperator_idx
return example_temp_file_path:sub(1, temp_path_length)
end
tempDir = get_temp_path()
function join_paths(...)
local arg={...}
path = ""
for i,v in ipairs(arg) do
path = utils.join_path(path, tostring(v))
end
return path;
end
ppid = utils.getpid()
os.execute("mkdir " .. join_paths(tempDir, "mpvSockets") .. " 2>/dev/null")
mp.set_property("options/input-ipc-server", join_paths(tempDir, "mpvSockets", ppid))
function shutdown_handler()
os.remove(join_paths(tempDir, "mpvSockets", ppid))
end
mp.register_event("shutdown", shutdown_handler)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.