Commit d2d4277c authored by Pierre Ynard's avatar Pierre Ynard

lua: remove obsolete preferred-resolution safeguards

These checked for the availability of vlc.var.inherit and
preferred-resolution at the time they were introduced, for script
compatibility with older VLC versions. By now it should be safe to
assume it's always available.
parent b20f17a5
...@@ -21,18 +21,6 @@ ...@@ -21,18 +21,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]] --]]
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Probe function. -- Probe function.
function probe() function probe()
if vlc.access ~= "http" and vlc.access ~= "https" then if vlc.access ~= "http" and vlc.access ~= "https" then
...@@ -44,7 +32,7 @@ end ...@@ -44,7 +32,7 @@ end
-- Parse function. -- Parse function.
function parse() function parse()
prefres = get_prefres() prefres = vlc.var.inherit(nil, "preferred-resolution")
while true while true
......
...@@ -20,17 +20,6 @@ ...@@ -20,17 +20,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]] --]]
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Probe function. -- Probe function.
function probe() function probe()
return vlc.access == "http" return vlc.access == "http"
...@@ -55,7 +44,7 @@ function parse() ...@@ -55,7 +44,7 @@ function parse()
end end
if string.match( vlc.path, "player%.extreme%.com/info/." ) then if string.match( vlc.path, "player%.extreme%.com/info/." ) then
prefres = get_prefres() prefres = vlc.var.inherit(nil, "preferred-resolution")
gostraight = true gostraight = true
while true do while true do
line = vlc.readline() line = vlc.readline()
......
...@@ -22,17 +22,6 @@ ...@@ -22,17 +22,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]] --]]
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Probe function. -- Probe function.
function probe() function probe()
return ( vlc.access == "http" or vlc.access == "https" ) return ( vlc.access == "http" or vlc.access == "https" )
...@@ -60,7 +49,7 @@ function parse() ...@@ -60,7 +49,7 @@ function parse()
else -- API URL else -- API URL
local prefres = get_prefres() local prefres = vlc.var.inherit(nil, "preferred-resolution")
local line = vlc.readline() -- data is on one line only local line = vlc.readline() -- data is on one line only
for stream in string.gmatch( line, "{([^}]*\"profile\":[^}]*)}" ) do for stream in string.gmatch( line, "{([^}]*\"profile\":[^}]*)}" ) do
......
...@@ -36,20 +36,9 @@ function get_arturl() ...@@ -36,20 +36,9 @@ function get_arturl()
return vlc.access.."://img.youtube.com/vi/"..video_id.."/default.jpg" return vlc.access.."://img.youtube.com/vi/"..video_id.."/default.jpg"
end end
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Pick the most suited format available -- Pick the most suited format available
function get_fmt( fmt_list ) function get_fmt( fmt_list )
local prefres = get_prefres() local prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres < 0 then if prefres < 0 then
return nil return nil
end end
......
...@@ -20,17 +20,6 @@ ...@@ -20,17 +20,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]] --]]
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Probe function. -- Probe function.
function probe() function probe()
return vlc.access == "http" return vlc.access == "http"
...@@ -58,7 +47,7 @@ function parse() ...@@ -58,7 +47,7 @@ function parse()
end end
if string.match ( vlc.path, "zapiks.fr/view/." ) then if string.match ( vlc.path, "zapiks.fr/view/." ) then
prefres = get_prefres() prefres = vlc.var.inherit(nil, "preferred-resolution")
while true do while true do
line = vlc.readline() line = vlc.readline()
if not line then break end if not line then break 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