Close properly from VLC
This commit is contained in:
parent
97a499a34a
commit
e23609edf5
@ -5,7 +5,7 @@
|
||||
Principal author: Etoh
|
||||
Other contributors: DerGenaue, jb
|
||||
Project: http://syncplay.pl/
|
||||
Version: 0.2.0
|
||||
Version: 0.2.1
|
||||
|
||||
Note:
|
||||
* This interface module is intended to be used in conjunction with Syncplay.
|
||||
@ -86,9 +86,10 @@ else
|
||||
require "common"
|
||||
end
|
||||
|
||||
local connectorversion = "0.2.0"
|
||||
local connectorversion = "0.2.1"
|
||||
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
|
||||
local loopsleepduration = 5000 -- Pause for every event loop (uses microseconds)
|
||||
local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops
|
||||
|
||||
local host = "localhost"
|
||||
local port
|
||||
@ -480,8 +481,9 @@ end
|
||||
|
||||
while running == true do
|
||||
--accept new connections and select active clients
|
||||
local quitcheckcounter = 0
|
||||
local fd = l:accept()
|
||||
local buffer, inputbuffer, responsebuffer = "", "", ""
|
||||
local buffer, inputbuffer, responsebuffer = ""
|
||||
while fd >= 0 and running == true do
|
||||
|
||||
-- handle read mode
|
||||
@ -532,6 +534,18 @@ while running == true do
|
||||
end
|
||||
vlc.misc.mwait(vlc.misc.mdate() + loopsleepduration) -- Don't waste processor time
|
||||
|
||||
-- check if VLC has been closed
|
||||
|
||||
quitcheckcounter = quitcheckcounter + 1
|
||||
|
||||
if quitcheckcounter > quitcheckfrequency then
|
||||
if vlc.volume.get() == -256 then
|
||||
running = false
|
||||
end
|
||||
quitcheckcounter = 0
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -43,7 +43,7 @@ COMMANDS_ROOM = ["r", "room"]
|
||||
COMMANDS_HELP = ['help', 'h', '?', '/?', r'\?']
|
||||
MPC_MIN_VER = "1.6.4"
|
||||
VLC_MIN_VERSION = "2.0.0"
|
||||
VLC_INTERFACE_MIN_VERSION = "0.2.0"
|
||||
VLC_INTERFACE_MIN_VERSION = "0.2.1"
|
||||
MPC_PATHS = [
|
||||
r"C:\Program Files (x86)\MPC-HC\mpc-hc.exe",
|
||||
r"C:\Program Files\MPC-HC\mpc-hc.exe",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user