Commit 7ba4c386 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Input location is always an URL

parent 8e1c86a0
...@@ -2380,8 +2380,6 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2380,8 +2380,6 @@ static int InputSourceInit( input_thread_t *p_input,
/* Preparsing is only for file:// */ /* Preparsing is only for file:// */
if( *psz_demux ) if( *psz_demux )
goto error; goto error;
if( !*psz_access ) /* path without scheme:// */
psz_access = "file";
if( strcmp( psz_access, "file" ) ) if( strcmp( psz_access, "file" ) )
goto error; goto error;
msg_Dbg( p_input, "trying to pre-parse %s", psz_path ); msg_Dbg( p_input, "trying to pre-parse %s", psz_path );
...@@ -2996,52 +2994,49 @@ static void input_ChangeState( input_thread_t *p_input, int i_state ) ...@@ -2996,52 +2994,49 @@ static void input_ChangeState( input_thread_t *p_input, int i_state )
void input_SplitMRL( const char **ppsz_access, const char **ppsz_demux, void input_SplitMRL( const char **ppsz_access, const char **ppsz_demux,
char **ppsz_path, char *psz_dup ) char **ppsz_path, char *psz_dup )
{ {
const char *psz_access; char *p;
const char *psz_demux = "";
char *psz_path;
/* Either there is an access/demux specification before :// /* Separate <path> from <access>[/<demux>]:// */
* or we have a plain local file path. */ p = strstr( psz_dup, "://" );
psz_path = strstr( psz_dup, "://" ); if( p != NULL )
if( psz_path != NULL )
{ {
*psz_path = '\0'; *p = '\0';
psz_path += 3; /* skips "://" */ p += 3; /* skips "://" */
*ppsz_path = p;
psz_access = psz_dup;
/* We really don't want module name substitution here! */
if( psz_access[0] == '$' )
psz_access++;
/* Separate access from demux (<access>/<demux>://<path>) */
char *p = strchr( psz_access, '/' );
if( p )
{
*p = '\0';
psz_demux = p + 1;
if( psz_demux[0] == '$' )
psz_demux++;
}
/* Remove HTML anchor if present (not supported). /* Remove HTML anchor if present (not supported).
* The hash symbol itself should be URI-encoded. */ * The hash symbol itself should be URI-encoded. */
p = strchr( psz_path, '#' ); p = strchr( p, '#' );
if( p ) if( p )
*p = '\0'; *p = '\0';
} }
else else
{ {
#ifndef NDEBUG #ifndef NDEBUG
fprintf( stderr, "%s(\"%s\"): not a valid URI!\n", __func__, fprintf( stderr, "%s(\"%s\") probably not a valid URI!\n", __func__,
psz_dup ); psz_dup );
#endif #endif
psz_path = psz_dup; /* Note: this is a valid non const pointer to "": */
psz_access = ""; *ppsz_path = psz_dup + strlen( psz_dup );
}
/* Separate access from demux */
p = strchr( psz_dup, '/' );
if( p != NULL )
{
*(p++) = '\0';
if( p[0] == '$' )
p++;
*ppsz_demux = p;
} }
else
*ppsz_demux = "";
*ppsz_access = psz_access; /* We really don't want module name substitution here! */
*ppsz_demux = psz_demux; p = psz_dup;
*ppsz_path = psz_path; if( p[0] == '$' )
p++;
*ppsz_access = p;
} }
static inline bool next(char ** src) static inline bool next(char ** src)
......
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