Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bf5d73b0
Commit
bf5d73b0
authored
Jan 20, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/libssh: factorize file_stat function
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki@gmail.com
>
parent
8d3f14e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
libssh.c
libavformat/libssh.c
+14
-8
No files found.
libavformat/libssh.c
View file @
bf5d73b0
...
...
@@ -108,6 +108,19 @@ static av_cold int libssh_open_file(LIBSSHContext *libssh, int flags, const char
return
0
;
}
static
av_cold
void
libssh_stat_file
(
LIBSSHContext
*
libssh
)
{
sftp_attributes
stat
;
if
(
!
(
stat
=
sftp_fstat
(
libssh
->
file
)))
{
av_log
(
libssh
,
AV_LOG_WARNING
,
"Cannot stat remote file.
\n
"
);
libssh
->
filesize
=
-
1
;
}
else
{
libssh
->
filesize
=
stat
->
size
;
sftp_attributes_free
(
stat
);
}
}
static
int
libssh_close
(
URLContext
*
h
)
{
LIBSSHContext
*
s
=
h
->
priv_data
;
...
...
@@ -131,7 +144,6 @@ static int libssh_open(URLContext *h, const char *url, int flags)
long
timeout
=
s
->
rw_timeout
*
1000
;
const
char
*
user
=
NULL
,
*
pass
=
NULL
;
char
*
end
=
NULL
;
sftp_attributes
stat
;
av_url_split
(
proto
,
sizeof
(
proto
),
credencials
,
sizeof
(
credencials
),
...
...
@@ -179,13 +191,7 @@ static int libssh_open(URLContext *h, const char *url, int flags)
if
((
ret
=
libssh_open_file
(
s
,
flags
,
path
))
<
0
)
goto
fail
;
if
(
!
(
stat
=
sftp_fstat
(
s
->
file
)))
{
av_log
(
h
,
AV_LOG_WARNING
,
"Cannot stat remote file %s.
\n
"
,
path
);
s
->
filesize
=
-
1
;
}
else
{
s
->
filesize
=
stat
->
size
;
sftp_attributes_free
(
stat
);
}
libssh_stat_file
(
s
);
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment