Commit ce58247d authored by Pierre Ynard's avatar Pierre Ynard

luahttp: use us_tonumber() for commands passing decimals

This fixes playback rate, track delay and equalizer settings.
(cherry picked from commit fff364519a7723f98c7be6a507893e21efc6c2bd)
Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
parent 6d85c42f
...@@ -74,7 +74,7 @@ processcommands = function () ...@@ -74,7 +74,7 @@ processcommands = function ()
local id = tonumber(_GET['id'] or -1) local id = tonumber(_GET['id'] or -1)
local val = _GET['val'] local val = _GET['val']
local options = _GET['option'] local options = _GET['option']
local band = _GET['band'] local band = tonumber(_GET['band'])
if type(options) ~= "table" then -- Deal with the 0 or 1 option case if type(options) ~= "table" then -- Deal with the 0 or 1 option case
options = { options } options = { options }
end end
...@@ -158,14 +158,17 @@ processcommands = function () ...@@ -158,14 +158,17 @@ processcommands = function ()
common.hotkey("key-"..val) common.hotkey("key-"..val)
elseif command == "audiodelay" then elseif command == "audiodelay" then
if vlc.object.input() and val then if vlc.object.input() and val then
val = common.us_tonumber(val)
vlc.var.set(vlc.object.input(),"audio-delay",val) vlc.var.set(vlc.object.input(),"audio-delay",val)
end end
elseif command == "rate" then elseif command == "rate" then
if vlc.object.input() and tonumber(val) >= 0 then val = common.us_tonumber(val)
if vlc.object.input() and val >= 0 then
vlc.var.set(vlc.object.input(),"rate",val) vlc.var.set(vlc.object.input(),"rate",val)
end end
elseif command == "subdelay" then elseif command == "subdelay" then
if vlc.object.input() then if vlc.object.input() then
val = common.us_tonumber(val)
vlc.var.set(vlc.object.input(),"spu-delay",val) vlc.var.set(vlc.object.input(),"spu-delay",val)
end end
elseif command == "aspectratio" then elseif command == "aspectratio" then
...@@ -173,8 +176,10 @@ processcommands = function () ...@@ -173,8 +176,10 @@ processcommands = function ()
vlc.var.set(vlc.object.vout(),"aspect-ratio",val) vlc.var.set(vlc.object.vout(),"aspect-ratio",val)
end end
elseif command == "preamp" then elseif command == "preamp" then
val = common.us_tonumber(val)
vlc.equalizer.preampset(val) vlc.equalizer.preampset(val)
elseif command == "equalizer" then elseif command == "equalizer" then
val = common.us_tonumber(val)
vlc.equalizer.equalizerset(band,val) vlc.equalizer.equalizerset(band,val)
elseif command == "enableeq" then elseif command == "enableeq" then
if val == '0' then vlc.equalizer.enable(false) else vlc.equalizer.enable(true) end if val == '0' then vlc.equalizer.enable(false) else vlc.equalizer.enable(true) end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment