mirror of
https://github.com/videolan/vlc.git
synced 2024-12-13 03:33:54 +08:00
Lua SD: freebox now should work correctly
This commit is contained in:
parent
ffa6a2fa83
commit
a97b78c2fb
@ -22,5 +22,28 @@
|
||||
--]]
|
||||
|
||||
function main()
|
||||
vlc.sd.add_item( {url="http://mafreebox.freebox.fr/freeboxtv/playlist.m3u",options={"deinterlace=1"}} )
|
||||
local fd = vlc.stream( "http://mafreebox.freebox.fr/freeboxtv/playlist.m3u" )
|
||||
local line= fd:readline()
|
||||
if line ~= "#EXTM3U" then
|
||||
return nil
|
||||
end
|
||||
line = fd:readline()
|
||||
local duration, artist, name
|
||||
local options={"deinterlace=1"}
|
||||
while line ~= nil do
|
||||
if( string.find( line, "#EXTINF" ) ) then
|
||||
_, _, duration, artist, name = string.find( line, ":(%w+),(%w+)%s*-%s*(.+)" )
|
||||
--TODO: fix the name not showing special characters correctly
|
||||
elseif( string.find( line, "#EXTVLCOPT" ) ) then
|
||||
_, _, option = string.find( line, ":(.+)" )
|
||||
table.insert( options, option )
|
||||
else
|
||||
vlc.sd.add_item( {url=line,duration=duration,artist=artist,title=name,options=options} )
|
||||
duration = nil
|
||||
artist = nil
|
||||
name = nil
|
||||
options={"deinterlace=1"}
|
||||
end
|
||||
line = fd:readline()
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user