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
31317656
Commit
31317656
authored
Sep 30, 2010
by
Stefano Sabatini
Committed by
Anton Khirnov
Apr 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file: implement url_check() callback in the file and pipe protocols
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
175389c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
file.c
libavformat/file.c
+16
-0
No files found.
libavformat/file.c
View file @
31317656
...
@@ -95,6 +95,20 @@ static int file_close(URLContext *h)
...
@@ -95,6 +95,20 @@ static int file_close(URLContext *h)
return
close
(
fd
);
return
close
(
fd
);
}
}
static
int
file_check
(
URLContext
*
h
,
int
mask
)
{
struct
stat
st
;
int
ret
=
stat
(
h
->
filename
,
&
st
);
if
(
ret
<
0
)
return
AVERROR
(
errno
);
ret
|=
st
.
st_mode
&
S_IRUSR
?
mask
&
AVIO_RDONLY
:
0
;
ret
|=
st
.
st_mode
&
S_IWUSR
?
mask
&
AVIO_WRONLY
:
0
;
ret
|=
st
.
st_mode
&
S_IWUSR
&&
st
.
st_mode
&
S_IRUSR
?
mask
&
AVIO_RDWR
:
0
;
return
ret
;
}
URLProtocol
ff_file_protocol
=
{
URLProtocol
ff_file_protocol
=
{
.
name
=
"file"
,
.
name
=
"file"
,
.
url_open
=
file_open
,
.
url_open
=
file_open
,
...
@@ -103,6 +117,7 @@ URLProtocol ff_file_protocol = {
...
@@ -103,6 +117,7 @@ URLProtocol ff_file_protocol = {
.
url_seek
=
file_seek
,
.
url_seek
=
file_seek
,
.
url_close
=
file_close
,
.
url_close
=
file_close
,
.
url_get_file_handle
=
file_get_handle
,
.
url_get_file_handle
=
file_get_handle
,
.
url_check
=
file_check
,
};
};
#endif
/* CONFIG_FILE_PROTOCOL */
#endif
/* CONFIG_FILE_PROTOCOL */
...
@@ -137,6 +152,7 @@ URLProtocol ff_pipe_protocol = {
...
@@ -137,6 +152,7 @@ URLProtocol ff_pipe_protocol = {
.
url_read
=
file_read
,
.
url_read
=
file_read
,
.
url_write
=
file_write
,
.
url_write
=
file_write
,
.
url_get_file_handle
=
file_get_handle
,
.
url_get_file_handle
=
file_get_handle
,
.
url_check
=
file_check
,
};
};
#endif
/* CONFIG_PIPE_PROTOCOL */
#endif
/* CONFIG_PIPE_PROTOCOL */
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