Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
eab5925f
Commit
eab5925f
authored
Nov 27, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error handling
parent
529cbee5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/access/file.c
modules/access/file.c
+18
-4
No files found.
modules/access/file.c
View file @
eab5925f
...
...
@@ -200,11 +200,23 @@ static int Open( vlc_object_t *p_this )
p_sys
->
b_seekable
=
VLC_FALSE
;
# ifdef HAVE_MMAP
if
(
p_sys
->
b_pace_control
&&
S_ISREG
(
st
.
st_mode
))
/* Autodetect mmap() support */
if
(
p_sys
->
b_pace_control
&&
S_ISREG
(
st
.
st_mode
)
&&
(
st
.
st_size
>
0
))
{
void
*
addr
=
mmap
(
NULL
,
1
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
);
if
(
addr
!=
MAP_FAILED
)
{
/* Does the file system needs to support mmap? */
munmap
(
addr
,
1
);
p_access
->
pf_read
=
NULL
;
p_access
->
pf_block
=
mmapBlock
;
msg_Dbg
(
p_this
,
"mmap enabled"
);
}
else
msg_Dbg
(
p_this
,
"mmap disabled (%m)"
);
}
else
msg_Dbg
(
p_this
,
"mmap disabled (non regular file)"
);
# endif
#else
p_sys
->
b_seekable
=
!
b_stdin
;
...
...
@@ -389,7 +401,9 @@ static block_t *mmapBlock (access_t *p_access)
addr
=
mmap
(
NULL
,
length
,
PROT_READ
,
flags
,
p_sys
->
fd
,
offset
);
if
(
addr
==
MAP_FAILED
)
{
msg_Err
(
p_access
,
"memory mapping failed: %m"
);
msg_Err
(
p_access
,
"memory mapping failed (%m)"
);
intf_UserFatal
(
p_access
,
VLC_FALSE
,
_
(
"File reading failed"
),
_
(
"VLC could not read the file."
));
msleep
(
INPUT_ERROR_SLEEP
);
return
NULL
;
}
...
...
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