Commit acb5da73 authored by Antoine Cellerier's avatar Antoine Cellerier

Change shoutcast service discovery module and write a new demux to be...

Change shoutcast service discovery module and write a new demux to be compatible with the new winamp 5.2 format. See trac ticket for detailed info. I'd appreciate if people could test this and proof read the code since we'll have to include this in 0.8.5 which is due to be released soon.

Ref #640.
parent fea437ab
...@@ -9,6 +9,7 @@ SOURCES_playlist = \ ...@@ -9,6 +9,7 @@ SOURCES_playlist = \
podcast.c \ podcast.c \
xspf.c \ xspf.c \
xspf.h \ xspf.h \
shoutcast.c \
$(NULL) $(NULL)
...@@ -90,6 +90,11 @@ vlc_module_begin(); ...@@ -90,6 +90,11 @@ vlc_module_begin();
add_shortcut( "xspf-open" ); add_shortcut( "xspf-open" );
set_capability( "demux2", 10 ); set_capability( "demux2", 10 );
set_callbacks( E_(xspf_import_Activate), NULL ); set_callbacks( E_(xspf_import_Activate), NULL );
add_submodule();
set_description( _("New winamp 5.2 shoutcast import") );
add_shortcut( "shout-winamp" );
set_capability( "demux2", 10 );
set_callbacks( E_(Import_Shoutcast), E_(Close_Shoutcast) );
vlc_module_end(); vlc_module_end();
......
...@@ -47,3 +47,6 @@ int E_(Import_podcast) ( vlc_object_t * ); ...@@ -47,3 +47,6 @@ int E_(Import_podcast) ( vlc_object_t * );
void E_(Close_podcast) ( vlc_object_t * ); void E_(Close_podcast) ( vlc_object_t * );
int E_(xspf_import_Activate) ( vlc_object_t * ); int E_(xspf_import_Activate) ( vlc_object_t * );
int E_(Import_Shoutcast) ( vlc_object_t * );
void E_(Close_Shoutcast) ( vlc_object_t * );
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Sigmund Augdal Helberg <dnumgis@videolan.org> * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
* Antoine Cellerier <dionoea -@T- videolan -d.t- org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
************************************************************************/ ************************************************************************/
#define MAX_LINE_LENGTH 256 #define MAX_LINE_LENGTH 256
#define SHOUTCAST_BASE_URL "http/shout-winamp://www.shoutcast.com/sbin/newxml.phtml"
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -58,19 +59,13 @@ ...@@ -58,19 +59,13 @@
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close( vlc_object_t * ); static void Close( vlc_object_t * );
#define LIMIT_TEXT N_("Number of streams")
/// \bug [String] -which would be listed + to list
#define LIMIT_LONGTEXT N_("Maximum number of Shoutcast radio streams which " \
"would be listed.")
vlc_module_begin(); vlc_module_begin();
set_shortname( "Shoutcast"); set_shortname( "Shoutcast");
set_description( _("Shoutcast radio listings") ); set_description( _("Shoutcast radio listings") );
set_category( CAT_PLAYLIST ); set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD ); set_subcategory( SUBCAT_PLAYLIST_SD );
add_integer( "shoutcast-limit", 1000, NULL, LIMIT_TEXT, add_suppressed_integer( "shoutcast-limit" );
LIMIT_LONGTEXT, VLC_TRUE );
set_capability( "services_discovery", 0 ); set_capability( "services_discovery", 0 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
...@@ -127,13 +122,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -127,13 +122,11 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_sys->i_limit = config_GetInt( p_this->p_libvlc, "shoutcast-limit" );
#define SHOUTCAST_BASE_URL "http/shout-b4s://www.shoutcast.com/sbin/xmllister.phtml?service=vlc&no_compress=1&limit="
psz_shoutcast_url = (char *)malloc( strlen( SHOUTCAST_BASE_URL ) + 20 ); psz_shoutcast_url = (char *)malloc( strlen( SHOUTCAST_BASE_URL ) + 20 );
psz_shoutcast_title = (char *)malloc( 6 + 20 ); psz_shoutcast_title = (char *)malloc( 6 + 20 );
sprintf( psz_shoutcast_url, SHOUTCAST_BASE_URL "%d", p_sys->i_limit ); sprintf( psz_shoutcast_url, SHOUTCAST_BASE_URL );
sprintf( psz_shoutcast_title, "Top %d", p_sys->i_limit ); sprintf( psz_shoutcast_title, "Shoutcast", p_sys->i_limit );
p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY ); p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY );
p_sys->p_node = playlist_NodeCreate( p_playlist, VIEW_CATEGORY, p_sys->p_node = playlist_NodeCreate( p_playlist, VIEW_CATEGORY,
......
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