Commit bc6c6306 authored by Antoine Cellerier's avatar Antoine Cellerier

Add option (--shoutcast-show-adult) to show porn^WNC17 rated video streams....

Add option (--shoutcast-show-adult) to show porn^WNC17 rated video streams. Default setting is of course disabled.
parent 8c722f37
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
#define AUTOSTART_LONGTEXT N_( "Automatically start playing the playlist " \ #define AUTOSTART_LONGTEXT N_( "Automatically start playing the playlist " \
"content once it's loaded.\n" ) "content once it's loaded.\n" )
#define SHOW_ADULT_TEXT N_( "Show shoutcast adult content" )
#define SHOW_ADULT_LONGTEXT N_( "Show NC17 rated video streams when " \
"using shoutcast video playlists." )
vlc_module_begin(); vlc_module_begin();
add_shortcut( "playlist" ); add_shortcut( "playlist" );
set_category( CAT_INPUT ); set_category( CAT_INPUT );
...@@ -95,6 +99,8 @@ vlc_module_begin(); ...@@ -95,6 +99,8 @@ vlc_module_begin();
add_shortcut( "shout-winamp" ); add_shortcut( "shout-winamp" );
set_capability( "demux2", 10 ); set_capability( "demux2", 10 );
set_callbacks( E_(Import_Shoutcast), E_(Close_Shoutcast) ); set_callbacks( E_(Import_Shoutcast), E_(Close_Shoutcast) );
add_bool( "shoutcast-show-adult", VLC_FALSE, NULL,
SHOW_ADULT_TEXT, SHOW_ADULT_LONGTEXT, VLC_FALSE );
vlc_module_end(); vlc_module_end();
......
...@@ -43,6 +43,8 @@ struct demux_sys_t ...@@ -43,6 +43,8 @@ struct demux_sys_t
xml_t *p_xml; xml_t *p_xml;
xml_reader_t *p_xml_reader; xml_reader_t *p_xml_reader;
vlc_bool_t b_adult;
}; };
/* duplicate from modules/services_discovery/shout.c */ /* duplicate from modules/services_discovery/shout.c */
...@@ -90,6 +92,11 @@ int E_(Import_Shoutcast)( vlc_object_t *p_this ) ...@@ -90,6 +92,11 @@ int E_(Import_Shoutcast)( vlc_object_t *p_this )
p_sys->p_xml = NULL; p_sys->p_xml = NULL;
p_sys->p_xml_reader = NULL; p_sys->p_xml_reader = NULL;
/* Do we want to list adult content ? */
var_Create( p_demux, "shoutcast-show-adult",
VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
p_sys->b_adult = var_GetBool( p_demux, "shoutcast-show-adult" );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -437,7 +444,8 @@ static int DemuxStation( demux_t *p_demux ) ...@@ -437,7 +444,8 @@ static int DemuxStation( demux_t *p_demux )
psz_eltname = xml_ReaderName( p_sys->p_xml_reader ); psz_eltname = xml_ReaderName( p_sys->p_xml_reader );
if( !psz_eltname ) return -1; if( !psz_eltname ) return -1;
if( !strcmp( psz_eltname, "station" ) && if( !strcmp( psz_eltname, "station" ) &&
( psz_base || ( psz_rt && psz_load ) ) ) ( psz_base || ( psz_rt && psz_load &&
( p_sys->b_adult || strcmp( psz_rt, "NC17" ) ) ) ) )
{ {
playlist_item_t *p_item; playlist_item_t *p_item;
char *psz_mrl = NULL; char *psz_mrl = NULL;
......
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