Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
02a9d087
Commit
02a9d087
authored
Oct 30, 2015
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vimeo.lua: fix video quality selection
Fixes #15778
parent
610ecb90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
share/lua/playlist/vimeo.lua
share/lua/playlist/vimeo.lua
+15
-6
No files found.
share/lua/playlist/vimeo.lua
View file @
02a9d087
...
@@ -50,18 +50,27 @@ function parse()
...
@@ -50,18 +50,27 @@ function parse()
else
-- API URL
else
-- API URL
local
prefres
=
vlc
.
var
.
inherit
(
nil
,
"preferred-resolution"
)
local
prefres
=
vlc
.
var
.
inherit
(
nil
,
"preferred-resolution"
)
local
bestres
=
nil
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
local
url
=
string.match
(
stream
,
"
\"
url\"
:
\
"(.-)\"" )
local
url
=
string.match
(
stream
,
"
\"
url\"
:
\
"(.-)\"" )
if url then
if url then
path = url
-- Apparently the different formats available are listed
if prefres < 0 then
-- in uncertain order of quality, so compare with what
break
-- we have so far.
end
local height = string.match( stream, "
\
"height\"
:(
%
d
+
)[,}]
" )
local height = string.match( stream, "
\
"height\"
:(
%
d
+
)[,}]
" )
if not height or tonumber(height) <= prefres then
height = tonumber( height )
break
-- Better than nothing
if not path or ( height and ( not bestres
-- Better quality within limits
or ( ( prefres < 0 or height <= prefres ) and height > bestres )
-- Lower quality more suited to limits
or ( prefres > -1 and bestres > prefres and height < bestres )
) ) then
path = url
bestres = height
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment