Commit a8c9e6b2 authored by Antoine Cellerier's avatar Antoine Cellerier

EXTVLCOPT parsing: Revert r23198 and backport r23299.

parent b1e84538
......@@ -24,6 +24,9 @@ Mac OS X Interface & Port:
* Support for current Ogg file formats
NOTE: This release requires Mac OS X 10.4 or higher. Mac OS X 10.3 is not supported anymore.
Other changes:
* You now need to append --m3u-extvlcopt to your command line to enable
EXTVLCOPT options parsing in m3u playlists.
Changes between 0.8.6b and 0.8.6c:
----------------------------------
......
......@@ -135,6 +135,10 @@ static int Demux( demux_t *p_demux )
char *psz_artist = NULL;
int i_parsed_duration = 0;
mtime_t i_duration = -1;
char **ppsz_options = NULL;
int i_options = 0, i;
vlc_bool_t b_enable_extvlcopt = config_GetInt( p_demux, "m3u-extvlcopt" );
playlist_item_t *p_item, *p_current;
vlc_bool_t b_play;
......@@ -186,6 +190,26 @@ static int Demux( demux_t *p_demux )
if ( psz_artist )
psz_artist = strdup( psz_artist );
}
else if( !strncasecmp( psz_parse, "EXTVLCOPT:",
sizeof("EXTVLCOPT:") -1 ) )
{
if( b_enable_extvlcopt )
{
/* VLC Option */
char *psz_option;
psz_parse += sizeof("EXTVLCOPT:") -1;
if( !*psz_parse ) goto error;
psz_option = MaybeFromLocaleDup( psz_parse );
if( psz_option )
INSERT_ELEM( ppsz_options, i_options, i_options,
psz_option );
}
else
{
msg_Err( p_demux, "m3u EXTVLCOPT parsing is disabled for security reasons. If you need it and trust the m3u playlist you are trying to open, please append --m3u-extvlcopt to you command line." );
}
}
}
else if( *psz_parse )
{
......@@ -203,6 +227,10 @@ static int Demux( demux_t *p_demux )
if( !psz_mrl ) goto error;
p_item = playlist_ItemNew( p_playlist, psz_mrl, psz_name );
for( i = 0; i< i_options; i++ )
{
playlist_ItemAddOption( p_item, ppsz_options[i] );
}
p_item->input.i_duration = i_duration;
if ( psz_artist && *psz_artist )
vlc_input_item_AddInfo( &p_item->input, _(VLC_META_INFO_CAT),
......@@ -232,6 +260,9 @@ static int Demux( demux_t *p_demux )
if( b_cleanup )
{
/* Cleanup state */
while( i_options-- ) free( ppsz_options[i_options] );
if( ppsz_options ) free( ppsz_options );
ppsz_options = NULL; i_options = 0;
if( psz_name ) free( psz_name );
psz_name = NULL;
if ( psz_artist ) free( psz_artist );
......
......@@ -42,6 +42,11 @@
#define SHOW_ADULT_LONGTEXT N_( "Show NC17 rated video streams when " \
"using shoutcast video playlists." )
#define EXTVLCOPT_TEXT N_( "Enable parsing of EXTVLCOPT: options" )
#define EXTVLCOPT_LONGTEXT N_( "Enable parsing of EXTVLCOPT: options in m3u " \
"playlists. This option is default disabled to prevent untrusted sources " \
"using VLC options without the user's knowledge." )
vlc_module_begin();
add_shortcut( "playlist" );
set_category( CAT_INPUT );
......@@ -67,6 +72,9 @@ vlc_module_begin();
set_description( _("M3U playlist import") );
add_shortcut( "m3u-open" );
set_capability( "demux2", 10 );
add_bool( "m3u-extvlcopt", VLC_FALSE, NULL,
EXTVLCOPT_TEXT, EXTVLCOPT_LONGTEXT, VLC_FALSE );
change_unsaveable();
set_callbacks( E_(Import_M3U), E_(Close_M3U) );
add_submodule();
set_description( _("PLS playlist import") );
......
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