]> git.sesse.net Git - vlc/commitdiff
Use file path instead of URL where appropriate
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 10 May 2010 20:15:55 +0000 (23:15 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 10 May 2010 20:31:54 +0000 (23:31 +0300)
modules/access/cdda.c
modules/access/directory.c
modules/access/file.c
modules/access/mmap.c
modules/access/mtp.c
modules/access/vcd/vcd.c

index 07da568c10748ef046baaa6c67c35ba4f58d1def..508a7ba7cd79d3ea36460061a0531758120a7175 100644 (file)
@@ -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] == ':' &&
index f2b8aec07913e54c84e2e9ad9c31e0273c07d651..782103bdbcb178a63d0cec88311177af82fdefbe 100644 (file)
@@ -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), &current->st))
index b96f60bb92496aa86c4eacfd1b7b7dd20ece3e24..be6b2a01179e51fb1a7aaa9dff97d0a1309abb6c 100644 (file)
@@ -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
index 2a591558a96e76a8cb3264f945df5a1dd6216ae7..24d894eacbaf5fd68f6e22f11ecf22f05d12f2d8 100644 (file)
@@ -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)));
index 261c943dee1f9efdd6dece214dfafcfcbc4d1511..3d42617326b5699df57b63481a2986dc2faee8c7 100644 (file)
@@ -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 );
 }
 
index 0b62bc2592ea89c7a97d991a9a8a5a7fbee14861..482625b5cdcd6eb2526e8676253dc66d95ed130e 100644 (file)
@@ -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;