Commit 6d4bc50f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Rename access_t.psz_path to psz_location

parent 370b6cbb
......@@ -80,7 +80,7 @@ struct access_t
/* Access name (empty if non forced) */
char *psz_access;
char *psz_path; /**< Location (URL with the scheme stripped) */
char *psz_location; /**< Location (URL with the scheme stripped) */
char *psz_filepath; /**< Local file path (if applicable) */
/* Access can fill this entry to force a demuxer
......
......@@ -73,13 +73,14 @@ static int Open(vlc_object_t *object)
return VLC_EGENERIC;
input_attachment_t *a;
if (input_Control(input, INPUT_GET_ATTACHMENT, &a, access->psz_path))
if (input_Control(input, INPUT_GET_ATTACHMENT, &a, access->psz_location))
a = NULL;
vlc_object_release(input);
if (!a) {
msg_Err(access, "Failed to find the attachment '%s'", access->psz_path);
msg_Err(access, "Failed to find the attachment '%s'",
access->psz_location);
return VLC_EGENERIC;
}
......
......@@ -84,8 +84,9 @@ int OpenAvio(vlc_object_t *object)
*/
char *url;
if (!strcmp(access->psz_access, "avio"))
url = strdup(access->psz_path);
else if (asprintf(&url, "%s://%s", access->psz_access, access->psz_path) < 0)
url = strdup(access->psz_location);
else if (asprintf(&url, "%s://%s", access->psz_access,
access->psz_location) < 0)
url = NULL;
if (!url)
......
......@@ -463,7 +463,7 @@ static int ParsePath( access_t *p_access, const char* psz_module,
}
for( int i = 0; i < i_param_count; i++ )
b_used[i] = false;
psz_parser = p_access->psz_path;
psz_parser = p_access->psz_location;
if( strlen( psz_parser ) <= 0 )
return VLC_SUCCESS;
......
......@@ -493,7 +493,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
msg_Dbg( p_access, "track[%d] start=%d", i, p_sys->p_sectors[i] );
/* */
if( asprintf( &psz_uri, "cdda://%s", p_access->psz_path ) == -1 )
if( asprintf( &psz_uri, "cdda://%s", p_access->psz_location ) == -1 )
psz_uri = NULL;
if( asprintf( &psz_opt, "cdda-track=%i", i+1 ) == -1 )
psz_opt = NULL;
......
......@@ -118,7 +118,7 @@ int DirInit (access_t *p_access, DIR *handle)
char *uri;
if (!strcmp (p_access->psz_access, "fd"))
{
if (asprintf (&uri, "fd://%s", p_access->psz_path) == -1)
if (asprintf (&uri, "fd://%s", p_access->psz_location) == -1)
uri = NULL;
}
else
......
......@@ -913,7 +913,7 @@ static void VarInit( access_t *p_access )
/* */
static int ParseMRL( access_t *p_access )
{
char *psz_dup = strdup( p_access->psz_path );
char *psz_dup = strdup( p_access->psz_location );
char *psz_parser = psz_dup;
char *psz_next;
vlc_value_t val;
......
......@@ -338,7 +338,7 @@ static int InOpen( vlc_object_t *p_this )
p_sys->out = false;
p_sys->directory = false;
if( parseURL( &p_sys->url, p_access->psz_path ) )
if( parseURL( &p_sys->url, p_access->psz_location ) )
goto exit_error;
if( Connect( p_this, p_sys ) )
......
......@@ -121,11 +121,11 @@ static int Open( vlc_object_t *p_this )
*(p_access->psz_access) != '\0')
{
asprintf( &psz_name, "%s://%s", p_access->psz_access,
p_access->psz_path );
p_access->psz_location );
}
else
{
psz_name = strdup( p_access->psz_path );
psz_name = strdup( p_access->psz_location );
}
psz = ToLocale( psz_name );
psz_expand_tilde = gnome_vfs_expand_initial_tilde( psz );
......
......@@ -320,7 +320,7 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
http_auth_Init( &p_sys->proxy_auth );
/* Parse URI - remove spaces */
p = psz = strdup( p_access->psz_path );
p = psz = strdup( p_access->psz_location );
while( (p = strchr( p, ' ' )) != NULL )
*p = '+';
vlc_UrlParse( &p_sys->url, psz, 0 );
......@@ -363,7 +363,7 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
{
char *buf;
int i;
i=asprintf(&buf, "%s://%s", psz_access, p_access->psz_path);
i=asprintf(&buf, "%s://%s", psz_access, p_access->psz_location);
if (i >= 0)
{
msg_Dbg(p_access, "asking libproxy about url '%s'", buf);
......@@ -581,8 +581,8 @@ connect:
msg_Err( p_access, "insecure redirection ignored" );
goto error;
}
free( p_access->psz_path );
p_access->psz_path = strdup( p_sys->psz_location );
free( p_access->psz_location );
p_access->psz_location = strdup( p_sys->psz_location );
/* Clean up current Open() run */
vlc_UrlClean( &p_sys->url );
http_auth_Reset( &p_sys->auth );
......
......@@ -300,7 +300,7 @@ static int OpenAccess(vlc_object_t *object)
access_t *access = (access_t *)object;
imem_sys_t *sys;
if (OpenCommon(object, &sys, access->psz_path))
if (OpenCommon(object, &sys, access->psz_location))
return VLC_EGENERIC;
if (var_InheritInteger(object, "imem-cat") != 4) {
......
......@@ -137,7 +137,7 @@ int MMSHOpen( access_t *p_access )
}
/* open a tcp connection */
vlc_UrlParse( &p_sys->url, p_access->psz_path, 0 );
vlc_UrlParse( &p_sys->url, p_access->psz_location, 0 );
if( ( p_sys->url.psz_host == NULL ) ||
( *p_sys->url.psz_host == '\0' ) )
{
......
......@@ -106,7 +106,7 @@ int MMSTUOpen( access_t *p_access )
vlc_mutex_init( &p_sys->lock_netwrite );
/* *** Parse URL and get server addr/port and path *** */
vlc_UrlParse( &p_sys->url, p_access->psz_path, 0 );
vlc_UrlParse( &p_sys->url, p_access->psz_location, 0 );
if( p_sys->url.psz_host == NULL || *p_sys->url.psz_host == '\0' )
{
msg_Err( p_access, "invalid server name" );
......
......@@ -110,8 +110,8 @@ static int Open( vlc_object_t *p_this )
/* Update default_pts to a suitable value for file access */
var_Create( p_access, "file-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
if( sscanf( p_access->psz_path, "%"SCNu32":%"SCNu8":%"SCNu16":%d", &i_bus,
&i_dev, &i_product_id, &i_track_id ) != 4 )
if( sscanf( p_access->psz_location, "%"SCNu32":%"SCNu8":%"SCNu16":%d",
&i_bus, &i_dev, &i_product_id, &i_track_id ) != 4 )
return VLC_EGENERIC;
i_ret = LIBMTP_Detect_Raw_Devices( &p_rawdevices, &i_numrawdevices );
if( i_ret != 0 || i_numrawdevices <= 0 || !p_rawdevices )
......
......@@ -577,7 +577,7 @@ static int Open( vlc_object_t * p_this )
p_sys->i_input = var_CreateGetInteger( p_access, "pvr-channel" );
/* parse command line options */
psz_tofree = strdup( p_access->psz_path );
psz_tofree = strdup( p_access->psz_location );
if( !psz_tofree )
{
free( p_sys->psz_radiodev );
......
......@@ -106,7 +106,7 @@ static int Open( vlc_object_t *p_this )
vlc_object_attach( p_sys->p_thread, p_access );
/* Parse URI - remove spaces */
p = psz = strdup( p_access->psz_path );
p = psz = strdup( p_access->psz_location );
while( (p = strchr( p, ' ' )) != NULL )
*p = '+';
vlc_UrlParse( &p_sys->p_thread->url, psz, 0 );
......
......@@ -193,7 +193,7 @@ static int Open( vlc_object_t *p_this )
p_sys->p_rtsp->pf_read_line = RtspReadLine;
p_sys->p_rtsp->pf_write = RtspWrite;
i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_path, 0 );
i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_location, 0 );
if( i_result )
{
msg_Dbg( p_access, "could not connect to: %s", p_access->psz_path );
......
......@@ -109,13 +109,13 @@ static int Open( vlc_object_t* p_this )
int i_ret;
vlc_url_t url;
if( !p_access->psz_path )
if( !p_access->psz_location )
return VLC_EGENERIC;
STANDARD_BLOCK_ACCESS_INIT;
/* Parse the URL */
char* path = p_access->psz_path;
const char* path = p_access->psz_location;
vlc_UrlParse( &url, path, 0 );
/* Check for some parameters */
......
......@@ -138,25 +138,25 @@ static int Open( vlc_object_t *p_this )
/* Parse input URI
* [[[domain;]user[:password@]]server[/share[/path[/file]]]] */
psz_path = strchr( p_access->psz_path, '/' );
psz_path = strchr( p_access->psz_location, '/' );
if( !psz_path )
{
msg_Err( p_access, "invalid SMB URI: smb://%s", psz_path );
msg_Err( p_access, "invalid SMB URI: smb://%s", psz_location );
return VLC_EGENERIC;
}
else
{
char *psz_tmp = strdup( p_access->psz_path );
char *psz_tmp = strdup( p_access->psz_location );
char *psz_parser;
psz_tmp[ psz_path - p_access->psz_path ] = 0;
psz_path = p_access->psz_path;
psz_tmp[ psz_path - p_access->psz_location ] = 0;
psz_path = p_access->psz_location;
psz_parser = strchr( psz_tmp, '@' );
if( psz_parser )
{
/* User info is there */
*psz_parser = 0;
psz_path = p_access->psz_path + (psz_parser - psz_tmp) + 1;
psz_path = p_access->psz_location + (psz_parser - psz_tmp) + 1;
psz_parser = strchr( psz_tmp, ':' );
if( psz_parser )
......@@ -230,7 +230,8 @@ static int Open( vlc_object_t *p_this )
#endif
if( (i_smb = smbc_open( psz_uri, O_RDONLY, 0 )) < 0 )
{
msg_Err( p_access, "open failed for '%s' (%m)", p_access->psz_path );
msg_Err( p_access, "open failed for '%s' (%m)",
p_access->psz_location );
free( psz_uri );
return VLC_EGENERIC;
}
......
......@@ -81,7 +81,7 @@ static int Open( vlc_object_t *p_this )
access_t *p_access = (access_t *)p_this;
access_sys_t *p_sys;
char *psz_dup = strdup(p_access->psz_path);
char *psz_dup = strdup(p_access->psz_location);
char *psz_parser = psz_dup;
/* Parse server:port */
......
......@@ -90,7 +90,7 @@ static int Open( vlc_object_t *p_this )
{
access_t *p_access = (access_t*)p_this;
char *psz_name = strdup( p_access->psz_path );
char *psz_name = strdup( p_access->psz_location );
char *psz_parser;
const char *psz_server_addr, *psz_bind_addr = "";
int i_bind_port, i_server_port = 0;
......
......@@ -1131,7 +1131,7 @@ static int AccessOpen( vlc_object_t * p_this )
GetV4L2Params( p_sys, (vlc_object_t *) p_access );
ParseMRL( p_sys, p_access->psz_path, (vlc_object_t *) p_access );
ParseMRL( p_sys, p_access->psz_location, (vlc_object_t *) p_access );
#ifdef HAVE_LIBV4L2
if( !var_InheritInteger( p_this, CFG_PREFIX "use-libv4l2" ) )
......
......@@ -563,12 +563,12 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
if( !p_access->psz_access || !*p_access->psz_access ) return NULL;
#endif
if( !p_access->psz_path )
if( !p_access->psz_location )
{
return NULL;
}
psz_parser = psz_source = strdup( p_access->psz_path );
psz_parser = psz_source = strdup( p_access->psz_location );
/* Parse input string :
* [device][@[type][title]] */
......@@ -884,7 +884,7 @@ VCDOpen ( vlc_object_t *p_this )
}
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT), "source: %s: mrl: %s",
psz_source, p_access->psz_path );
psz_source, p_access->psz_location );
p_vcdplayer->psz_source = strdup(psz_source);
p_vcdplayer->i_blocks_per_read = var_InheritInteger( p_this, MODULE_STRING
......
......@@ -105,9 +105,9 @@ int AccessOpen( vlc_object_t *p_this )
char *psz_pathToZip = NULL, *psz_path = NULL, *psz_sep = NULL;
if( !strstr( p_access->psz_path, ZIP_SEP ) )
if( !strstr( p_access->psz_location, ZIP_SEP ) )
{
msg_Dbg( p_access, "path does not contain separator " ZIP_SEP );
msg_Dbg( p_access, "location does not contain separator " ZIP_SEP );
return VLC_EGENERIC;
}
......@@ -117,7 +117,7 @@ int AccessOpen( vlc_object_t *p_this )
return VLC_ENOMEM;
/* Split the MRL */
psz_path = strdup( p_access->psz_path );
psz_path = strdup( p_access->psz_location );
psz_sep = strstr( psz_path, ZIP_SEP );
*psz_sep = '\0';
......@@ -125,7 +125,7 @@ int AccessOpen( vlc_object_t *p_this )
if( !psz_pathToZip )
{
/* Maybe this was not an encoded string */
msg_Dbg( p_access, "this is not an encoded url. Trying file '%s'",
msg_Dbg( p_access, "not an encoded URL Trying file '%s'",
psz_path );
psz_pathToZip = strdup( psz_path );
}
......
......@@ -63,7 +63,7 @@ access_t *__access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
p_access->p_input = p_parent_input;
p_access->psz_access = strdup( psz_access );
p_access->psz_path = strdup( psz_location );
p_access->psz_location = strdup( psz_location );
p_access->psz_filepath = get_path( psz_location );
p_access->psz_demux = strdup( psz_demux );
......@@ -86,7 +86,7 @@ access_t *__access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
if( p_access->p_module == NULL )
{
free( p_access->psz_access );
free( p_access->psz_path );
free( p_access->psz_location );
free( p_access->psz_filepath );
free( p_access->psz_demux );
vlc_object_release( p_access );
......@@ -104,7 +104,7 @@ void access_Delete( access_t *p_access )
module_unneed( p_access, p_access->p_module );
free( p_access->psz_access );
free( p_access->psz_path );
free( p_access->psz_location );
free( p_access->psz_filepath );
free( p_access->psz_demux );
......
......@@ -294,7 +294,7 @@ stream_t *stream_AccessNew( access_t *p_access, char **ppsz_list )
return NULL;
s->p_input = p_access->p_input;
s->psz_path = strdup( p_access->psz_path );
s->psz_path = strdup( p_access->psz_location );
s->p_sys = p_sys = malloc( sizeof( *p_sys ) );
if( !s->psz_path || !s->p_sys )
{
......@@ -339,7 +339,7 @@ stream_t *stream_AccessNew( access_t *p_access, char **ppsz_list )
goto error;
p_entry->i_size = p_access->info.i_size;
p_entry->psz_path = strdup( p_access->psz_path );
p_entry->psz_path = strdup( p_access->psz_location );
if( !p_entry->psz_path )
{
free( p_entry );
......
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