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 @@
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.
function probe()
if vlc.access ~= "http" and vlc.access ~= "https" then
......@@ -44,7 +32,7 @@ end
-- Parse function.
function parse()
prefres = get_prefres()
prefres = vlc.var.inherit(nil, "preferred-resolution")
while true
......
......@@ -20,17 +20,6 @@
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.
function probe()
return vlc.access == "http"
......@@ -55,7 +44,7 @@ function parse()
end
if string.match( vlc.path, "player%.extreme%.com/info/." ) then
prefres = get_prefres()
prefres = vlc.var.inherit(nil, "preferred-resolution")
gostraight = true
while true do
line = vlc.readline()
......
......@@ -22,17 +22,6 @@
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.
function probe()
return ( vlc.access == "http" or vlc.access == "https" )
......@@ -60,7 +49,7 @@ function parse()
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
for stream in string.gmatch( line, "{([^}]*\"profile\":[^}]*)}" ) do
......
......@@ -36,20 +36,9 @@ function get_arturl()
return vlc.access.."://img.youtube.com/vi/"..video_id.."/default.jpg"
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
function get_fmt( fmt_list )
local prefres = get_prefres()
local prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres < 0 then
return nil
end
......
......@@ -20,17 +20,6 @@
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.
function probe()
return vlc.access == "http"
......@@ -58,7 +47,7 @@ function parse()
end
if string.match ( vlc.path, "zapiks.fr/view/." ) then
prefres = get_prefres()
prefres = vlc.var.inherit(nil, "preferred-resolution")
while true do
line = vlc.readline()
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