From 43d5e9adeda831056410fd13e723d372ad47196e Mon Sep 17 00:00:00 2001 From: Etoh Date: Mon, 24 Jun 2013 21:53:42 +0200 Subject: [PATCH] Make syncplay.lua use VLC 2.1.X running/closing code --- resources/syncplay.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/syncplay.lua b/resources/syncplay.lua index c0effb1..493b684 100644 --- a/resources/syncplay.lua +++ b/resources/syncplay.lua @@ -96,6 +96,8 @@ local oldinputstate local newfilepath local newinputstate +running = true + -- Start hosting Syncplay interface. port = tonumber(config["port"]) @@ -347,7 +349,7 @@ function do_command ( command, argument) elseif command == "set-rate" then errormsg = set_var("rate", tonumber(argument)) elseif command == "display-osd" then errormsg = display_osd(argument) elseif command == "load-file" then response = load_file(argument) - elseif command == "close-vlc" then vlc.misc.quit() + elseif command == "close-vlc" then close_vlc() else errormsg = unknowncommand end @@ -359,6 +361,10 @@ function do_command ( command, argument) end +function close_vlc() + vlc.misc.quit() + running = false +end function errormerge(argument, errormsg) -- Used to integrate 'no-input' error messages into command responses. @@ -387,7 +393,7 @@ function set_playstate(argument) end -- main loop, which alternates between writing and reading -while not vlc.misc.should_die() do +while running do -- accept new connections and select active clients local write, read = h:accept_and_select()