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
71890248
Commit
71890248
authored
Feb 09, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decomp: use vlc_pipe()
parent
c8778a81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+3
-14
No files found.
modules/stream_filter/decomp.c
View file @
71890248
...
...
@@ -26,6 +26,7 @@
#include <vlc_plugin.h>
#include <vlc_stream.h>
#include <vlc_network.h>
#include <vlc_fs.h>
#include <assert.h>
#include <unistd.h>
#include <errno.h>
...
...
@@ -74,12 +75,6 @@ struct stream_sys_t
int
write_fd
,
read_fd
;
};
static
void
cloexec
(
int
fd
)
{
int
flags
=
fcntl
(
fd
,
F_GETFD
);
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
|
((
flags
!=
-
1
)
?
flags
:
0
));
}
extern
char
**
environ
;
static
const
size_t
bufsize
=
65536
;
...
...
@@ -285,15 +280,13 @@ static int Open (stream_t *stream, const char *path)
/* We use two pipes rather than one stream socket pair, so that we can
* use vmsplice() on Linux. */
if
(
pipe
(
comp
)
==
0
)
if
(
vlc_
pipe
(
comp
)
==
0
)
{
cloexec
(
comp
[
1
]);
p_sys
->
write_fd
=
comp
[
1
];
int
uncomp
[
2
];
if
(
pipe
(
uncomp
)
==
0
)
if
(
vlc_
pipe
(
uncomp
)
==
0
)
{
cloexec
(
uncomp
[
0
]);
p_sys
->
read_fd
=
uncomp
[
0
];
#if (_POSIX_SPAWN >= 0)
...
...
@@ -303,9 +296,7 @@ static int Open (stream_t *stream, const char *path)
char
*
const
argv
[]
=
{
(
char
*
)
path
,
NULL
};
if
(
!
posix_spawn_file_actions_adddup2
(
&
actions
,
comp
[
0
],
0
)
&&
!
posix_spawn_file_actions_addclose
(
&
actions
,
comp
[
0
])
&&
!
posix_spawn_file_actions_adddup2
(
&
actions
,
uncomp
[
1
],
1
)
&&
!
posix_spawn_file_actions_addclose
(
&
actions
,
uncomp
[
1
])
&&
!
posix_spawnp
(
&
p_sys
->
pid
,
path
,
&
actions
,
NULL
,
argv
,
environ
))
{
...
...
@@ -328,9 +319,7 @@ static int Open (stream_t *stream, const char *path)
break
;
case
0
:
dup2
(
comp
[
0
],
0
);
close
(
comp
[
0
]);
dup2
(
uncomp
[
1
],
1
);
close
(
uncomp
[
1
]);
execlp
(
path
,
path
,
(
char
*
)
NULL
);
exit
(
1
);
/* if we get, execlp() failed! */
default:
...
...
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