Commit 4b295c7c authored by Antoine Cellerier's avatar Antoine Cellerier

Allow specifying options specific to each url in the shout service discovery.

Make it possible to inherit the m3u-extvlcopt option in the m3u parser.
parent 0212c515
......@@ -109,7 +109,8 @@ static int Demux( demux_t *p_demux )
const char**ppsz_options = NULL;
int i_options = 0;
vlc_bool_t b_cleanup = VLC_FALSE;
vlc_bool_t b_enable_extvlcopt = config_GetInt( p_demux, "m3u-extvlcopt" );
vlc_bool_t b_enable_extvlcopt = var_CreateGetInteger( p_demux,
"m3u-extvlcopt" );
input_item_t *p_input;
INIT_PLAYLIST_STUFF;
......@@ -220,6 +221,7 @@ static int Demux( demux_t *p_demux )
}
}
HANDLE_PLAY_AND_RELEASE;
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
......
......@@ -43,13 +43,14 @@ static const struct
{
const char *psz_url;
const char *psz_name;
const char *ppsz_options[2];
} p_items[] = {
{ "http/shout-winamp://www.shoutcast.com/sbin/newxml.phtml",
N_("Shoutcast Radio") },
N_("Shoutcast Radio"), { NULL } },
{ "http/shout-winamp://www.shoutcast.com/sbin/newtvlister.phtml?alltv=1",
N_("Shoutcast TV") },
N_("Shoutcast TV"), { NULL } },
{ "http://mafreebox.freebox.fr/freeboxtv/playlist.m3u",
N_("Freebox TV") },
N_("Freebox TV"), { "m3u-extvlcopt=1", NULL } },
};
/* Main functions */
......@@ -128,11 +129,15 @@ static void ItemAdded( const vlc_event_t * p_event, void * user_data )
static void Run( services_discovery_t *p_sd )
{
enum type_e i_type = (enum type_e)p_sd->p_sys;
int i;
input_item_t *p_input = input_ItemNewExt( p_sd,
p_items[i_type].psz_url, _(p_items[i_type].psz_name),
0, NULL, -1 );
for( i = 0; p_items[i_type].ppsz_options[i] != NULL; i++ )
input_ItemAddOption( p_input, p_items[i_type].ppsz_options[i] );
input_ItemAddOption( p_input, "no-playlist-autostart" );
vlc_gc_incref( p_input );
vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded,
ItemAdded, p_sd );
......
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