X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fsftp.c;h=9f419a63d8ed91f57db8274908a9484f758f4848;hb=8a497301054ccc2d9d470ade60264036d43e3fc0;hp=8da576495327dcfe2236f21871dd9c4abe869839;hpb=631a992c7bbbc9da57526c2c4edae036d6c26a78;p=vlc diff --git a/modules/access/sftp.c b/modules/access/sftp.c index 8da5764953..9f419a63d8 100644 --- a/modules/access/sftp.c +++ b/modules/access/sftp.c @@ -79,7 +79,7 @@ vlc_module_end () * Local prototypes *****************************************************************************/ static block_t* Block( access_t * ); -static int Seek( access_t *, int64_t ); +static int Seek( access_t *, uint64_t ); static int Control( access_t *, int, va_list ); @@ -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 */ @@ -134,7 +134,7 @@ static int Open( vlc_object_t* p_this ) else { dialog_Login( p_access, &psz_username, &psz_password, - _("SFTP authentification"), + _("SFTP authentication"), _("Please enter a valid login and password for the sftp " "connexion to %s"), url.psz_host ); if( EMPTY_STR(psz_username) || !psz_password ) @@ -198,11 +198,11 @@ static int Open( vlc_object_t* p_this ) goto error; } - /* Get some informations */ + /* Get some information */ LIBSSH2_SFTP_ATTRIBUTES attributes; if( libssh2_sftp_stat( p_sys->sftp_session, url.psz_path, &attributes ) ) { - msg_Err( p_access, "Impossible to get informations about the remote file %s", url.psz_path ); + msg_Err( p_access, "Impossible to get information about the remote file %s", url.psz_path ); goto error; } p_access->info.i_size = attributes.filesize; @@ -216,15 +216,11 @@ static int Open( vlc_object_t* p_this ) vlc_UrlClean( &url ); return VLC_SUCCESS; - error: free( psz_password ); free( psz_username ); - if( p_sys ) - { - vlc_UrlClean( &url ); - free( p_sys ); - } + vlc_UrlClean( &url ); + free( p_sys ); return VLC_EGENERIC; } @@ -278,7 +274,7 @@ static block_t* Block( access_t* p_access ) } -static int Seek( access_t* p_access, int64_t i_pos ) +static int Seek( access_t* p_access, uint64_t i_pos ) { p_access->info.i_pos = i_pos; p_access->info.b_eof = false; @@ -313,7 +309,7 @@ static int Control( access_t* p_access, int i_query, va_list args ) case ACCESS_GET_PTS_DELAY: pi_64 = (int64_t*)va_arg( args, int64_t* ); - *pi_64 = (int64_t)var_GetInteger( p_access, "sftp-caching" ) * INT64_C(1000); + *pi_64 = var_GetInteger( p_access, "sftp-caching" ) * INT64_C(1000); break; case ACCESS_SET_PAUSE_STATE: