From 6d4bc50f38f446d21a9d8eabf983e7b6584d9474 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 10 May 2010 23:30:48 +0300 Subject: [PATCH] Rename access_t.psz_path to psz_location --- include/vlc_access.h | 2 +- modules/access/attachment.c | 5 +++-- modules/access/avio.c | 5 +++-- modules/access/bda/bda.c | 2 +- modules/access/cdda.c | 2 +- modules/access/directory.c | 2 +- modules/access/dvb/access.c | 2 +- modules/access/ftp.c | 2 +- modules/access/gnomevfs.c | 4 ++-- modules/access/http.c | 8 ++++---- modules/access/imem.c | 2 +- modules/access/mms/mmsh.c | 2 +- modules/access/mms/mmstu.c | 2 +- modules/access/mtp.c | 4 ++-- modules/access/pvr.c | 2 +- modules/access/rtmp/access.c | 2 +- modules/access/rtsp/access.c | 2 +- modules/access/sftp.c | 4 ++-- modules/access/smb.c | 15 ++++++++------- modules/access/tcp.c | 2 +- modules/access/udp.c | 2 +- modules/access/v4l2.c | 2 +- modules/access/vcdx/access.c | 6 +++--- modules/access/zip/zipaccess.c | 8 ++++---- src/input/access.c | 6 +++--- src/input/stream.c | 4 ++-- 26 files changed, 51 insertions(+), 48 deletions(-) diff --git a/include/vlc_access.h b/include/vlc_access.h index 554f2f8b49..103badbb03 100644 --- a/include/vlc_access.h +++ b/include/vlc_access.h @@ -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 diff --git a/modules/access/attachment.c b/modules/access/attachment.c index d2e043c03f..ac5f3dae5b 100644 --- a/modules/access/attachment.c +++ b/modules/access/attachment.c @@ -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; } diff --git a/modules/access/avio.c b/modules/access/avio.c index 2063f086e8..639e2c20b7 100644 --- a/modules/access/avio.c +++ b/modules/access/avio.c @@ -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) diff --git a/modules/access/bda/bda.c b/modules/access/bda/bda.c index 98cd85abad..5fbe68eafc 100644 --- a/modules/access/bda/bda.c +++ b/modules/access/bda/bda.c @@ -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; diff --git a/modules/access/cdda.c b/modules/access/cdda.c index 508a7ba7cd..43b824b8f5 100644 --- a/modules/access/cdda.c +++ b/modules/access/cdda.c @@ -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; diff --git a/modules/access/directory.c b/modules/access/directory.c index 782103bdbc..8c4950f491 100644 --- a/modules/access/directory.c +++ b/modules/access/directory.c @@ -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 diff --git a/modules/access/dvb/access.c b/modules/access/dvb/access.c index 4fa4b43103..046570941d 100644 --- a/modules/access/dvb/access.c +++ b/modules/access/dvb/access.c @@ -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; diff --git a/modules/access/ftp.c b/modules/access/ftp.c index 0684a3880c..0dc1de1244 100644 --- a/modules/access/ftp.c +++ b/modules/access/ftp.c @@ -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 ) ) diff --git a/modules/access/gnomevfs.c b/modules/access/gnomevfs.c index 93852102d2..d39d54d36e 100644 --- a/modules/access/gnomevfs.c +++ b/modules/access/gnomevfs.c @@ -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 ); diff --git a/modules/access/http.c b/modules/access/http.c index d0a53d7a84..9fc2a74b86 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -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 ); diff --git a/modules/access/imem.c b/modules/access/imem.c index ab41aade58..c3e17fbd03 100644 --- a/modules/access/imem.c +++ b/modules/access/imem.c @@ -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) { diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c index f3d93ae858..9833483df6 100644 --- a/modules/access/mms/mmsh.c +++ b/modules/access/mms/mmsh.c @@ -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' ) ) { diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c index 45e363d2d2..ce4f5df3d4 100644 --- a/modules/access/mms/mmstu.c +++ b/modules/access/mms/mmstu.c @@ -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" ); diff --git a/modules/access/mtp.c b/modules/access/mtp.c index 3d42617326..1f0e4c5075 100644 --- a/modules/access/mtp.c +++ b/modules/access/mtp.c @@ -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 ) diff --git a/modules/access/pvr.c b/modules/access/pvr.c index b7d91e9de0..88a3070c6a 100644 --- a/modules/access/pvr.c +++ b/modules/access/pvr.c @@ -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 ); diff --git a/modules/access/rtmp/access.c b/modules/access/rtmp/access.c index 2c556f68e3..c7f5ed7bac 100644 --- a/modules/access/rtmp/access.c +++ b/modules/access/rtmp/access.c @@ -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 ); diff --git a/modules/access/rtsp/access.c b/modules/access/rtsp/access.c index bf2dd76291..c5dcc1460d 100644 --- a/modules/access/rtsp/access.c +++ b/modules/access/rtsp/access.c @@ -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 ); diff --git a/modules/access/sftp.c b/modules/access/sftp.c index 01795e015c..ed75dece53 100644 --- a/modules/access/sftp.c +++ b/modules/access/sftp.c @@ -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 */ diff --git a/modules/access/smb.c b/modules/access/smb.c index d2648a478f..f35a8801d5 100644 --- a/modules/access/smb.c +++ b/modules/access/smb.c @@ -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; } diff --git a/modules/access/tcp.c b/modules/access/tcp.c index 6c2d50aeca..3f33b9b1d7 100644 --- a/modules/access/tcp.c +++ b/modules/access/tcp.c @@ -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 */ diff --git a/modules/access/udp.c b/modules/access/udp.c index 765c2d03ea..cb5068bcf4 100644 --- a/modules/access/udp.c +++ b/modules/access/udp.c @@ -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; diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c index 9ad9edc1c9..41baaf808d 100644 --- a/modules/access/v4l2.c +++ b/modules/access/v4l2.c @@ -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" ) ) diff --git a/modules/access/vcdx/access.c b/modules/access/vcdx/access.c index 91c77616d6..5d0aeff6f1 100644 --- a/modules/access/vcdx/access.c +++ b/modules/access/vcdx/access.c @@ -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 diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c index 3e4689bb33..f862b0cdd3 100644 --- a/modules/access/zip/zipaccess.c +++ b/modules/access/zip/zipaccess.c @@ -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 ); } diff --git a/src/input/access.c b/src/input/access.c index 82d27b5a01..e99455b719 100644 --- a/src/input/access.c +++ b/src/input/access.c @@ -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 ); diff --git a/src/input/stream.c b/src/input/stream.c index eedd3a4a4c..f0a90dc128 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -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 ); -- 2.11.4.GIT