Reduce VLC CPU use (DerGenaue's code, adapted)

This commit is contained in:
Et0h 2014-05-19 14:49:52 +01:00
parent 10089bb417
commit 69c03bdaa5
2 changed files with 9 additions and 5 deletions

View File

@ -2,9 +2,10 @@
syncplay.lua: Syncplay interface module for VLC
--[==========================================================================[
Author: Etoh
Principal author: Etoh
Other contributors: DerGenaue, jb
Project: http://syncplay.pl/
Version: 0.1.9
Version: 0.2.0
Note:
* This interface module is intended to be used in conjunction with Syncplay.
@ -85,8 +86,10 @@ else
require "common"
end
local connectorversion = "0.1.9"
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability
local connectorversion = "0.2.0"
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 host = "localhost"
local port
@ -526,6 +529,7 @@ while running == true do
vlc.net.send( fd, responsebuffer )
responsebuffer = ""
end
vlc.misc.mwait(vlc.misc.mdate() + loopsleepduration) -- Don't waste processor time
end

View File

@ -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.1.9"
VLC_INTERFACE_MIN_VERSION = "0.2.0"
MPC_PATHS = [
r"C:\Program Files (x86)\MPC-HC\mpc-hc.exe",
r"C:\Program Files\MPC-HC\mpc-hc.exe",