Commit 370b6cbb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use file path instead of URL where appropriate

parent c20f0e81
......@@ -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] == ':' &&
......
......@@ -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))
......
......@@ -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
......
......@@ -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)));
......
......@@ -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 );
}
......
......@@ -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;
......
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