From 370b6cbb300d4db09701b156a5cf899896958c56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 10 May 2010 23:15:55 +0300 Subject: [PATCH] Use file path instead of URL where appropriate --- modules/access/cdda.c | 4 ++-- modules/access/directory.c | 8 ++++---- modules/access/file.c | 2 +- modules/access/mmap.c | 2 +- modules/access/mtp.c | 21 +++++++++++++-------- modules/access/vcd/vcd.c | 2 +- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/modules/access/cdda.c b/modules/access/cdda.c index 07da568c10..508a7ba7cd 100644 --- a/modules/access/cdda.c +++ b/modules/access/cdda.c @@ -139,7 +139,7 @@ static int Open( vlc_object_t *p_this ) vcddev_t *vcddev; char *psz_name; - if( !p_access->psz_path || !*p_access->psz_path ) + if( !p_access->psz_filepath || !*p_access->psz_filepath ) { /* Only when selected */ if( !p_access->psz_access || !*p_access->psz_access ) @@ -152,7 +152,7 @@ static int Open( vlc_object_t *p_this ) return VLC_EGENERIC; } } - else psz_name = ToLocaleDup( p_access->psz_path ); + else psz_name = ToLocaleDup( p_access->psz_filepath ); #ifdef WIN32 if( psz_name[0] && psz_name[1] == ':' && diff --git a/modules/access/directory.c b/modules/access/directory.c index f2b8aec079..782103bdbc 100644 --- a/modules/access/directory.c +++ b/modules/access/directory.c @@ -99,10 +99,10 @@ int DirOpen( vlc_object_t *p_this ) { access_t *p_access = (access_t*)p_this; - if( !p_access->psz_path ) + if( !p_access->psz_filepath ) return VLC_EGENERIC; - DIR *handle = vlc_opendir (p_access->psz_path); + DIR *handle = vlc_opendir (p_access->psz_filepath); if (handle == NULL) return VLC_EGENERIC; @@ -122,7 +122,7 @@ int DirInit (access_t *p_access, DIR *handle) uri = NULL; } else - uri = make_URI (p_access->psz_path); + uri = make_URI (p_access->psz_filepath); if (unlikely(uri == NULL)) goto error; @@ -238,7 +238,7 @@ block_t *DirBlock (access_t *p_access) current->parent = NULL; current->handle = p_sys->handle; #ifndef HAVE_OPENAT - current->path = strdup (p_access->psz_path); + current->path = strdup (p_access->psz_filepath); #endif current->uri = p_sys->uri; if (fstat (dirfd (current->handle), ¤t->st)) diff --git a/modules/access/file.c b/modules/access/file.c index b96f60bb92..be6b2a0117 100644 --- a/modules/access/file.c +++ b/modules/access/file.c @@ -133,7 +133,7 @@ static bool IsRemote (int fd) int Open( vlc_object_t *p_this ) { access_t *p_access = (access_t*)p_this; - const char *path = p_access->psz_path; + const char *path = p_access->psz_filepath; #ifdef WIN32 bool is_remote = false; #endif diff --git a/modules/access/mmap.c b/modules/access/mmap.c index 2a591558a9..24d894eacb 100644 --- a/modules/access/mmap.c +++ b/modules/access/mmap.c @@ -83,7 +83,7 @@ static int Open (vlc_object_t *p_this) { access_t *p_access = (access_t *)p_this; access_sys_t *p_sys; - const char *path = p_access->psz_path; + const char *path = p_access->psz_filepath; int fd; assert ((INT64_C(1) << 63) == ((off_t)(INT64_C(1) << 63))); diff --git a/modules/access/mtp.c b/modules/access/mtp.c index 261c943dee..3d42617326 100644 --- a/modules/access/mtp.c +++ b/modules/access/mtp.c @@ -126,8 +126,10 @@ static int Open( vlc_object_t *p_this ) if( ( p_device = LIBMTP_Open_Raw_Device( &p_rawdevices[i] ) ) != NULL ) { - free( p_access->psz_path ); - if( ( p_access->psz_path = tempnam( NULL, "vlc" ) ) == NULL ) + free( p_access->psz_filepath ); +#warning Oooh no! Not tempnam()! + p_access->psz_filepath = tempnam( NULL, "vlc" ); + if( p_access->psz_filepath == NULL ) { LIBMTP_Release_Device( p_device ); free( p_rawdevices ); @@ -135,9 +137,11 @@ static int Open( vlc_object_t *p_this ) } else { - msg_Dbg( p_access, "About to write %s", p_access->psz_path ); + msg_Dbg( p_access, "About to write %s", + p_access->psz_filepath ); LIBMTP_Get_File_To_File( p_device, i_track_id, - p_access->psz_path, NULL, NULL ); + p_access->psz_filepath, NULL, + NULL ); LIBMTP_Release_Device( p_device ); i = i_numrawdevices; } @@ -156,8 +160,8 @@ static int Open( vlc_object_t *p_this ) int fd = p_sys->fd = -1; /* Open file */ - msg_Dbg( p_access, "opening file `%s'", p_access->psz_path ); - fd = open_file( p_access, p_access->psz_path ); + msg_Dbg( p_access, "opening file `%s'", p_access->psz_filepath ); + fd = open_file( p_access, p_access->psz_filepath ); if( fd == -1 ) { @@ -187,8 +191,9 @@ static void Close( vlc_object_t * p_this ) access_sys_t *p_sys = p_access->p_sys; close ( p_sys->fd ); - if( vlc_unlink( p_access->psz_path ) != 0 ) - msg_Err( p_access, "Error deleting file %s, %m", p_access->psz_path ); + if( vlc_unlink( p_access->psz_filepath ) != 0 ) + msg_Err( p_access, "Error deleting file %s, %m", + p_access->psz_filepath ); free( p_sys ); } diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c index 0b62bc2592..482625b5cd 100644 --- a/modules/access/vcd/vcd.c +++ b/modules/access/vcd/vcd.c @@ -96,7 +96,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 = ToLocaleDup( p_access->psz_path ); + char *psz_dup = ToLocaleDup( p_access->psz_filepath ); char *psz; int i_title = 0; int i_chapter = 0; -- 2.39.5