if(! ( POKE( p_peek, "#EXTM3U", 7 ) || POKE( p_peek, "RTSPtext", 8 ) ||
demux_IsPathExtension( p_demux, ".m3u" ) || demux_IsPathExtension( p_demux, ".vlc" ) ||
- /* A .ram file can contain a single rtsp link */
- demux_IsPathExtension( p_demux, ".ram" ) || demux_IsPathExtension( p_demux, ".rm" ) ||
demux_IsForced( p_demux, "m3u" ) || ContainsURL( p_demux ) ) )
return VLC_EGENERIC;
static bool ContainsURL( demux_t *p_demux )
{
- uint8_t *p_peek;
+ const uint8_t *p_peek, *p_peek_end;
int i_peek;
- uint8_t *p_peek_end;
i_peek = stream_Peek( p_demux->s, &p_peek, 1024 );
if( i_peek <= 0 ) return false;
while( p_peek + sizeof( "https://" ) < p_peek_end )
{
/* One line starting with an URL is enough */
- if( !strncasecmp( p_peek, "http://", sizeof( "http://" ) - 1 ) ||
- !strncasecmp( p_peek, "mms://", sizeof( "mms://" ) - 1 ) ||
- !strncasecmp( p_peek, "rtsp://", sizeof( "rtsp://" ) - 1 ) ||
- !strncasecmp( p_peek, "https://", sizeof( "https://" ) - 1 ) ||
- !strncasecmp( p_peek, "ftp://", sizeof( "ftp://" ) - 1 ) )
+ if( !strncasecmp( (const char *)p_peek, "http://", 7 ) ||
+ !strncasecmp( (const char *)p_peek, "mms://", 6 ) ||
+ !strncasecmp( (const char *)p_peek, "rtsp://", 7 ) ||
+ !strncasecmp( (const char *)p_peek, "https://", 8 ) ||
+ !strncasecmp( (const char *)p_peek, "ftp://", 6 ) )
{
return true;
}
b_cleanup = true;
if( !psz_mrl ) goto error;
- p_input = input_ItemNewExt( p_demux, psz_mrl, psz_name,
- 0, NULL, i_duration );
+ p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
+ i_options, ppsz_options, 0, i_duration );
if ( psz_artist && *psz_artist )
input_item_SetArtist( p_input, psz_artist );
- input_ItemAddSubItem( p_current_input, p_input );
- for( int i = 0; i < i_options; i++ )
- input_ItemAddOpt( p_input, ppsz_options[i], 0 );
+ input_item_AddSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
free( psz_mrl );
}