Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
ecc5eb9d
Commit
ecc5eb9d
authored
Dec 22, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put debug/test code for mmap
(it does not find any error here)
parent
cfdc3865
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
modules/access/file.c
modules/access/file.c
+20
-1
No files found.
modules/access/file.c
View file @
ecc5eb9d
...
...
@@ -372,6 +372,13 @@ static block_t *mmapBlock (access_t *p_access)
size_t
length
=
(
MMAP_SIZE
>
p_sys
->
pagemask
)
?
MMAP_SIZE
:
(
p_sys
->
pagemask
+
1
);
void
*
addr
;
#ifndef NDEBUG
int64_t
dbgpos
=
lseek
(
p_sys
->
fd
,
0
,
SEEK_CUR
);
if
(
dbgpos
!=
p_access
->
info
.
i_pos
)
msg_Err
(
p_access
,
"position: 0x%08llx instead of 0x%08llx"
,
p_access
->
info
.
i_pos
,
dbgpos
);
#endif
if
(
p_access
->
info
.
i_pos
>=
p_access
->
info
.
i_size
)
{
/* End of file - check if file size changed... */
...
...
@@ -429,6 +436,18 @@ static block_t *mmapBlock (access_t *p_access)
block
->
length
=
length
;
//vlc_object_yield (block->owner = VLC_OBJECT (p_access));
#ifndef NDEBUG
/* Compare normal I/O with memory mapping */
char
buf
[
block
->
self
.
i_buffer
];
ssize_t
i_read
=
read
(
p_sys
->
fd
,
buf
,
block
->
self
.
i_buffer
);
if
(
i_read
!=
(
ssize_t
)
block
->
self
.
i_buffer
)
msg_Err
(
p_access
,
"read %u instead of %u bytes"
,
(
unsigned
)
i_read
,
(
unsigned
)
block
->
self
.
i_buffer
);
if
(
memcmp
(
buf
,
block
->
self
.
p_buffer
,
block
->
self
.
i_buffer
))
msg_Err
(
p_access
,
"inconsistent data buffer"
);
#endif
return
&
block
->
self
;
}
#endif
...
...
@@ -451,7 +470,7 @@ static int Seek (access_t *p_access, int64_t i_pos)
p_access
->
info
.
i_pos
=
i_pos
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
#if
def HAVE_MMAP
#if
defined (HAVE_MMAP) && defined (NDEBUG)
if
(
p_access
->
pf_block
==
NULL
)
#endif
lseek
(
p_access
->
p_sys
->
fd
,
i_pos
,
SEEK_SET
);
...
...
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