Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
6f029c3e
Commit
6f029c3e
authored
Dec 10, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still try to splice as many memory pages as possible
parent
77cb7de9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+8
-6
No files found.
modules/stream_filter/decomp.c
View file @
6f029c3e
...
...
@@ -83,7 +83,7 @@ static void *Thread (void *data)
stream_t
*
stream
=
data
;
stream_sys_t
*
p_sys
=
stream
->
p_sys
;
#ifdef __linux__
uintptr
_t
page_mask
=
sysconf
(
_SC_PAGE_SIZE
)
-
1
;
ssize
_t
page_mask
=
sysconf
(
_SC_PAGE_SIZE
)
-
1
;
#endif
int
fd
=
p_sys
->
write_fd
;
bool
error
=
false
;
...
...
@@ -108,14 +108,16 @@ static void *Thread (void *data)
for
(
ssize_t
i
=
0
,
j
;
i
<
len
;
i
+=
j
)
{
struct
iovec
iov
[
1
]
=
{
{
buf
+
i
,
len
-
i
,
}
};
#ifdef __linux__
if
((
(
len
|
i
)
&
page_mask
)
==
0
)
j
=
vmsplice
(
fd
,
iov
,
1
,
SPLICE_F_GIFT
);
if
((
len
-
i
)
<=
page_mask
)
/* incomplete last page */
j
=
write
(
fd
,
buf
+
i
,
len
-
i
);
else
{
struct
iovec
iov
=
{
buf
+
i
,
(
len
-
i
)
&
~
page_mask
,
};
j
=
vmsplice
(
fd
,
&
iov
,
1
,
SPLICE_F_GIFT
);
}
#else
j
=
writev
(
fd
,
iov
,
1
);
j
=
write
(
fd
,
buf
+
i
,
len
-
i
);
#endif
if
(
j
<=
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