diff --git a/mpv.conf b/mpv.conf index d9ef75c..5578f0e 100644 --- a/mpv.conf +++ b/mpv.conf @@ -11,7 +11,7 @@ border=no # geometry=50% autofit=50% volume=75 -audio-spdif=ac3,eac3,dts-hd,truehd +audio-spdif=ac3,dts-hd,truehd # glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl" # glsl-shaders="~~/shaders/FSRCNNX.glsl:~~/shaders/FSR.glsl:~~/shaders/NVScaler.glsl:~~/shaders/CAS-scaled.glsl" # glsl-shaders="~~/shaders/ArtCNN_C4F32_DS.glsl" diff --git a/scripts/run_websocket_server.lua b/scripts/run_websocket_server.lua index 2f7e07e..840fe25 100644 --- a/scripts/run_websocket_server.lua +++ b/scripts/run_websocket_server.lua @@ -8,75 +8,75 @@ local platform = mp.get_property_native("platform") local config_file_path = mp.find_config_file("mpv.conf") local config_folder_path, config_file = utils.split_path(config_file_path) local mpv_websocket_path = - utils.join_path(config_folder_path, platform == "windows" and "mpv_websocket.exe" or "mpv_websocket") + utils.join_path(config_folder_path, platform == "windows" and "mpv_websocket.exe" or "mpv_websocket") local initialised_websocket local _, err = utils.file_info(config_file_path) if err then - error("failed to open mpv config file `" .. config_file_path .. "`") + error("failed to open mpv config file `" .. config_file_path .. "`") end local _, err = utils.file_info(mpv_websocket_path) if err then - error("failed to open mpv_websocket") + error("failed to open mpv_websocket") end local function find_mpv_socket(config_file_path) - local file = io.open(config_file_path, "r") - if file == nil then - error("failed to read mpv config file `" .. config_file_path .. "`") - end + local file = io.open(config_file_path, "r") + if file == nil then + error("failed to read mpv config file `" .. config_file_path .. "`") + end - local mpv_socket - for line in file:lines() do - mpv_socket = line:match("^input%-ipc%-server%s*=%s*(%g+)%s*") - if mpv_socket then - break - end - end + local mpv_socket + for line in file:lines() do + mpv_socket = line:match("^input%-ipc%-server%s*=%s*(%g+)%s*") + if mpv_socket then + break + end + end - file:close() + file:close() - if not mpv_socket then - error("input-ipc-server option does not exist in `" .. config_file_path .. "`") - end + if not mpv_socket then + error("input-ipc-server option does not exist in `" .. config_file_path .. "`") + end - return mpv_socket + return mpv_socket end local mpv_socket = find_mpv_socket(config_file_path) if platform == "windows" then - mpv_socket = "\\\\.\\pipe" .. mpv_socket:gsub("/", "\\") + mpv_socket = "\\\\.\\pipe" .. mpv_socket:gsub("/", "\\") end local function start_websocket() - initialised_websocket = mp.command_native_async({ - name = "subprocess", - playback_only = false, - capture_stdout = true, - capture_stderr = true, - args = { - mpv_websocket_path, - "-m", - mpv_socket, - "-w", - "6677", - }, - }) + initialised_websocket = mp.command_native_async({ + name = "subprocess", + playback_only = false, + capture_stdout = true, + capture_stderr = true, + args = { + mpv_websocket_path, + "-m", + mpv_socket, + "-w", + "6677", + }, + }) end local function end_websocket() - mp.abort_async_command(initialised_websocket) - initialised_websocket = nil + mp.abort_async_command(initialised_websocket) + initialised_websocket = nil end local function toggle_websocket() - local paused = mp.get_property_bool("pause") - if initialised_websocket and paused then - end_websocket() - elseif not initialised_websocket and not paused then - start_websocket() - end + local paused = mp.get_property_bool("pause") + if initialised_websocket and paused then + end_websocket() + elseif not initialised_websocket and not paused then + start_websocket() + end end mp.register_script_message("togglewebsocket", toggle_websocket) diff --git a/scripts/subs2srs b/scripts/subs2srs index 5435ee0..db1fdaf 160000 --- a/scripts/subs2srs +++ b/scripts/subs2srs @@ -1 +1 @@ -Subproject commit 5435ee033fc328926fde0423051ebe5149629d0b +Subproject commit db1fdaf40b3753fc308aa3152954e2edc491330e