[vlc-commits] [Git][videolan/vlc][master] UPnP: remove SAT>IP channel list fallback
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Jul 7 14:32:36 UTC 2024
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
3df7b6e1 by Felix Paul Kühne at 2024-07-07T14:16:16+00:00
UPnP: remove SAT>IP channel list fallback
When introducing SAT>IP support, we added a fallback mechanism on
officially published channel lists in case the user neither specified
a custom list nor the used set-top box provided one.
With the end of the SAT>IP Alliance that was dissolved 3 years ago, the
fallback server is no longer available and there will be no replacement
so this feature was removed.
Fixes #28684
- - - - -
1 changed file:
- modules/services_discovery/upnp.cpp
Changes:
=====================================
modules/services_discovery/upnp.cpp
=====================================
@@ -56,7 +56,6 @@ const char* CONTENT_DIRECTORY_SERVICE_TYPE = "urn:schemas-upnp-org:service:Conte
const char* SATIP_SERVER_DEVICE_TYPE = "urn:ses-com:device:SatIPServer:1";
#define UPNP_SEARCH_TIMEOUT_SECONDS 15
-#define SATIP_CHANNEL_LIST N_("SAT>IP channel list")
#define SATIP_CHANNEL_LIST_URL N_("Custom SAT>IP channel list URL")
#define HTTP_PORT 7070
@@ -75,13 +74,6 @@ const char* SATIP_SERVER_DEVICE_TYPE = "urn:ses-com:device:SatIPServer:1";
#define URL_TEXT N_("description URL")
#define URL_LONGTEXT N_("The Url used to get the xml descriptor of the UPnP Renderer")
-static const char *const ppsz_satip_channel_lists[] = {
- "auto", "ASTRA_19_2E", "ASTRA_28_2E", "ASTRA_23_5E", "MasterList", "ServerList", "CustomList"
-};
-static const char *const ppsz_readible_satip_channel_lists[] = {
- N_("Auto"), "Astra 19.2°E", "Astra 28.2°E", "Astra 23.5°E", N_("SAT>IP Main List"), N_("Device List"), N_("Custom List")
-};
-
namespace {
/*
@@ -143,9 +135,7 @@ vlc_module_begin()
set_capability( "services_discovery", 0 )
set_callbacks( SD::OpenSD, SD::CloseSD )
- add_string( "satip-channelist", "auto", SATIP_CHANNEL_LIST,
- nullptr )
- change_string_list( ppsz_satip_channel_lists, ppsz_readible_satip_channel_lists )
+ add_obsolete_string( "satip-channelist" ) /* since 3.0.22 */
add_string( "satip-channellist-url", NULL, SATIP_CHANNEL_LIST_URL,
nullptr )
@@ -662,114 +652,60 @@ MediaServerList::parseSatipServer( IXML_Element* p_device_element, const char *p
{
SD::MediaServerDesc* p_server = NULL;
- char *psz_satip_channellist = var_InheritString( m_sd, "satip-channelist");
-
- /* In Auto mode, default to MasterList list from satip.info */
- bool automode = false;
- if( !psz_satip_channellist || /* On lookup failure or empty string, use auto mode */
- strcmp(psz_satip_channellist, "auto") == 0 ||
- strcmp(psz_satip_channellist, "Auto") == 0 ) /* for backwards compatibility */
- {
- automode = true;
- if( psz_satip_channellist )
- free(psz_satip_channellist);
- psz_satip_channellist = strdup( "MasterList" );
- if( unlikely( !psz_satip_channellist ) )
- return;
- }
-
vlc_url_t url;
vlc_UrlParse( &url, psz_base_url );
/* Part 1: a user may have provided a custom playlist url */
- if (strcmp(psz_satip_channellist, "CustomList") == 0) {
- char *psz_satip_playlist_url = var_InheritString( m_sd, "satip-channellist-url" );
- if ( psz_satip_playlist_url ) {
- p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_satip_playlist_url, iconUrl );
-
- if( likely( p_server ) ) {
- p_server->satIpHost = url.psz_host;
- p_server->isSatIp = true;
- if( !addServer( p_server ) ) {
- delete p_server;
- }
- }
+ char *psz_satip_playlist_url = var_InheritString( m_sd, "satip-channellist-url" );
+ if ( psz_satip_playlist_url ) {
+ p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_satip_playlist_url, iconUrl );
- /* to comply with the SAT>IP specification, we don't fall back on another channel list if this path failed */
- free( psz_satip_channellist );
- free( psz_satip_playlist_url );
- vlc_UrlClean( &url );
- return;
+ if ( likely( p_server ) ) {
+ p_server->satIpHost = url.psz_host;
+ p_server->isSatIp = true;
+ if( !addServer( p_server ) ) {
+ delete p_server;
+ }
}
+
+ /* to comply with the SAT>IP specification, we don't fall back on another channel list if this path failed */
+ free( psz_satip_playlist_url );
+ vlc_UrlClean( &url );
+ return;
}
/* Part 2: device playlist
* In Automatic mode, or if requested by the user, check for a SAT>IP m3u list on the device */
- if (automode || strcmp(psz_satip_channellist, "ServerList") == 0) {
- const char* psz_m3u_url = xml_getChildElementValue( p_device_element, "satip:X_SATIPM3U" );
- if ( psz_m3u_url ) {
- if ( strncmp( "http", psz_m3u_url, 4) )
- {
- char* psz_url = NULL;
- if ( UpnpResolveURL2( psz_base_url, psz_m3u_url, &psz_url ) == UPNP_E_SUCCESS )
- {
- p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_url, iconUrl );
- free(psz_url);
- }
- } else {
- p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_m3u_url, iconUrl );
- }
-
- if ( unlikely( !p_server ) )
+ const char* psz_m3u_url = xml_getChildElementValue( p_device_element, "satip:X_SATIPM3U" );
+ if ( psz_m3u_url ) {
+ if ( strncmp( "http", psz_m3u_url, 4) )
+ {
+ char* psz_url = NULL;
+ if ( UpnpResolveURL2( psz_base_url, psz_m3u_url, &psz_url ) == UPNP_E_SUCCESS )
{
- free( psz_satip_channellist );
- vlc_UrlClean( &url );
- return;
+ p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_url, iconUrl );
+ free(psz_url);
}
-
- p_server->satIpHost = url.psz_host;
- p_server->isSatIp = true;
- if ( !addServer( p_server ) )
- delete p_server;
} else {
- msg_Dbg( m_sd, "SAT>IP server '%s' did not provide a playlist", url.psz_host);
+ p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_m3u_url, iconUrl );
}
- if (!automode) {
- /* to comply with the SAT>IP specifications, we don't fallback on another channel list if this path failed,
- * but in Automatic mode, we continue */
- free(psz_satip_channellist);
+ if ( unlikely( !p_server ) ) {
vlc_UrlClean( &url );
return;
}
- }
-
- /* Part 3: satip.info playlist
- * In the normal case, fetch a playlist from the satip website,
- * which will be processed by a lua script a bit later, to make it work sanely
- * MasterList is a list of usual Satellites */
-
- char *psz_url;
- if (asprintf( &psz_url, "https://www.satip.info/Playlists/%s.m3u",
- psz_satip_channellist ) < 0 ) {
- vlc_UrlClean( &url );
- free( psz_satip_channellist );
- return;
- }
-
- p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn,
- psz_friendly_name, psz_url, iconUrl );
- if( likely( p_server ) ) {
p_server->satIpHost = url.psz_host;
p_server->isSatIp = true;
- if( !addServer( p_server ) ) {
+ if ( !addServer( p_server ) ) {
delete p_server;
+ } else {
+ msg_Err( m_sd, "SAT>IP server '%s' did not provide a playlist", url.psz_host);
}
+
+ /* to comply with the SAT>IP specifications, we don't fallback on another channel list if this path failed */
+ vlc_UrlClean( &url );
}
- free( psz_url );
- free( psz_satip_channellist );
- vlc_UrlClean( &url );
}
void MediaServerList::removeServer( const std::string& udn )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3df7b6e1187030591febd8e1bdd2712c0d6af132
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3df7b6e1187030591febd8e1bdd2712c0d6af132
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list