[vlc-devel] [PATCH 4/6] Drop lua requirement for SAT>IP playlists

Felix Paul Kühne fkuehne at videolan.org
Wed Jul 20 17:25:20 CEST 2016


From: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
---
 modules/services_discovery/upnp.cpp |  4 +--
 share/Makefile.am                   |  2 --
 share/lua/playlist/satip.lua        | 65 -------------------------------------
 3 files changed, 2 insertions(+), 69 deletions(-)
 delete mode 100644 share/lua/playlist/satip.lua

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 42a813a..59453a4 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -460,7 +460,7 @@ void MediaServerList::parseNewServer( IXML_Document *doc, const std::string &loc
                     vlc_UrlParse( &device_url, psz_base_url );
 
                     char *used_psz_url = NULL;
-                    if (asprintf( &used_psz_url, "%s/lua://%s%s?device=%s",
+                    if (asprintf( &used_psz_url, "%s://%s%s?satip-device=%s",
                                  custom_playlist_url.psz_protocol,
                                  custom_playlist_url.psz_host,
                                  custom_playlist_url.psz_path,
@@ -518,7 +518,7 @@ void MediaServerList::parseNewServer( IXML_Document *doc, const std::string &loc
             vlc_url_t url;
             vlc_UrlParse( &url, psz_base_url );
 
-            if (asprintf( &psz_url, "http/lua://www.satip.info/Playlists/%s.m3u?device=%s",
+            if (asprintf( &psz_url, "http://www.satip.info/Playlists/%s.m3u?satip-device=%s",
                          psz_satip_channellist,
                          url.psz_host ) < 0 ) {
                 vlc_UrlClean( &url );
diff --git a/share/Makefile.am b/share/Makefile.am
index 4a5458e..1e96bf6 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -149,7 +149,6 @@ nobase_vlclib_DATA = \
 	lua/playlist/pinkbike.luac \
 	lua/playlist/pluzz.luac \
 	lua/playlist/rockbox_fm_presets.luac \
-	lua/playlist/satip.luac \
 	lua/playlist/soundcloud.luac \
 	lua/playlist/vimeo.luac \
 	lua/playlist/youtube.luac \
@@ -243,7 +242,6 @@ EXTRA_DIST += \
 	lua/playlist/pinkbike.lua \
 	lua/playlist/pluzz.lua \
 	lua/playlist/rockbox_fm_presets.lua \
-	lua/playlist/satip.lua \
 	lua/playlist/soundcloud.lua \
 	lua/playlist/vimeo.lua \
 	lua/playlist/youtube.lua \
diff --git a/share/lua/playlist/satip.lua b/share/lua/playlist/satip.lua
deleted file mode 100644
index 6cb1323..0000000
--- a/share/lua/playlist/satip.lua
+++ /dev/null
@@ -1,65 +0,0 @@
---[[
- $Id$
-
- Copyright © 2015 Videolabs SAS
-
- Authors: Felix Paul Kühne (fkuehne at videolan.org)
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
---]]
-
-function get_url_param( url, name )
-    local _, _, res = string.find( url, "[&?]"..name.."=([^&]*)" )
-    return res
-end
-
--- Probe function.
-function probe()
-        if vlc.access ~= "http" then
-        return false
-    end
-
-    return ( string.match( vlc.path, "www.satip.info" ) )
-end
-
--- Parse function.
-function parse()
-    local satiphost = get_url_param( vlc.path, "device")
-
-    vlc.msg.dbg("Parsing SAT>IP playlist for host "..satiphost)
-
-    -- Skip the prefix line
-    line = vlc.readline()
-
-    p = {}
-
-    while true do
-        name = vlc.readline()
-        if not name then break end
-
-        name = vlc.strings.from_charset( "ISO_8859-1", name )
-        name = string.gsub(name,"#EXTINF:0,","")
-
-        url = vlc.readline()
-        if not url then break end
-
-        finalurl = string.gsub(url,"sat.ip",satiphost)
-        finalurl = string.gsub(finalurl,"rtsp","satip")
-
-        table.insert( p, { path = finalurl, url = finalurl, name = name } )
-    end
-
-    return p
-end
-- 
2.9.2



More information about the vlc-devel mailing list