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
e7c7f475
Commit
e7c7f475
authored
Jun 03, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules: use vlc_write() where appropriate
parent
d89c4195
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
25 deletions
+8
-25
modules/access_output/file.c
modules/access_output/file.c
+1
-20
modules/access_output/livehttp.c
modules/access_output/livehttp.c
+4
-2
modules/lua/libs/net.c
modules/lua/libs/net.c
+1
-1
modules/video_filter/dynamicoverlay/dynamicoverlay.c
modules/video_filter/dynamicoverlay/dynamicoverlay.c
+2
-2
No files found.
modules/access_output/file.c
View file @
e7c7f475
...
...
@@ -106,16 +106,10 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
return
i_write
;
}
#if (_POSIX_REALTIME_SIGNALS > 0)
static
ssize_t
WritePipe
(
sout_access_out_t
*
access
,
block_t
*
block
)
{
int
fd
=
(
intptr_t
)
access
->
p_sys
;
ssize_t
total
=
0
;
sigset_t
set
,
oldset
;
sigemptyset
(
&
set
);
sigaddset
(
&
set
,
SIGPIPE
);
pthread_sigmask
(
SIG_BLOCK
,
&
set
,
&
oldset
);
while
(
block
!=
NULL
)
{
...
...
@@ -128,19 +122,12 @@ static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
}
/* TODO: vectorized I/O with writev() */
ssize_t
val
=
write
(
fd
,
block
->
p_buffer
,
block
->
i_buffer
);
ssize_t
val
=
vlc_
write
(
fd
,
block
->
p_buffer
,
block
->
i_buffer
);
if
(
val
<
0
)
{
if
(
errno
==
EINTR
)
continue
;
if
(
errno
==
EPIPE
)
{
siginfo_t
info
;
struct
timespec
ts
=
{
0
,
0
};
while
(
sigtimedwait
(
&
set
,
&
info
,
&
ts
)
>
0
);
}
block_ChainRelease
(
block
);
msg_Err
(
access
,
"cannot write: %s"
,
vlc_strerror_c
(
errno
));
total
=
-
1
;
...
...
@@ -154,14 +141,8 @@ static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
block
->
i_buffer
-=
val
;
}
if
(
!
sigismember
(
&
oldset
,
SIGPIPE
))
pthread_sigmask
(
SIG_SETMASK
,
&
oldset
,
NULL
);
return
total
;
}
#else
# define WritePipe Write
#endif
#ifdef S_ISSOCK
static
ssize_t
Send
(
sout_access_out_t
*
access
,
block_t
*
block
)
...
...
modules/access_output/livehttp.c
View file @
e7c7f475
...
...
@@ -721,7 +721,8 @@ static void closeCurrentSegment( sout_access_out_t *p_access, sout_access_out_sy
if
(
err
)
{
msg_Err
(
p_access
,
"Couldn't encrypt 16 bytes: %s"
,
gpg_strerror
(
err
)
);
}
else
{
int
ret
=
write
(
p_sys
->
i_handle
,
p_sys
->
stuffing_bytes
,
16
);
int
ret
=
vlc_write
(
p_sys
->
i_handle
,
p_sys
->
stuffing_bytes
,
16
);
if
(
ret
!=
16
)
msg_Err
(
p_access
,
"Couldn't write 16 bytes"
);
}
...
...
@@ -984,7 +985,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
crypted
=
true
;
}
ssize_t
val
=
write
(
p_sys
->
i_handle
,
output
->
p_buffer
,
output
->
i_buffer
);
ssize_t
val
=
vlc_write
(
p_sys
->
i_handle
,
output
->
p_buffer
,
output
->
i_buffer
);
if
(
val
==
-
1
)
{
if
(
errno
==
EINTR
)
...
...
modules/lua/libs/net.c
View file @
e7c7f475
...
...
@@ -388,7 +388,7 @@ static int vlclua_fd_write( lua_State *L )
const
char
*
psz_buffer
=
luaL_checklstring
(
L
,
2
,
&
i_len
);
i_len
=
luaL_optint
(
L
,
3
,
i_len
);
lua_pushinteger
(
L
,
(
fd
!=
-
1
)
?
write
(
fd
,
psz_buffer
,
i_len
)
:
-
1
);
lua_pushinteger
(
L
,
(
fd
!=
-
1
)
?
vlc_
write
(
fd
,
psz_buffer
,
i_len
)
:
-
1
);
return
1
;
}
...
...
modules/video_filter/dynamicoverlay/dynamicoverlay.c
View file @
e7c7f475
...
...
@@ -315,8 +315,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
/* Try emptying the output buffer */
if
(
p_sys
->
i_outputfd
!=
-
1
)
{
ssize_t
i_len
=
write
(
p_sys
->
i_outputfd
,
p_sys
->
output
.
p_begin
,
p_sys
->
output
.
i_length
);
ssize_t
i_len
=
vlc_
write
(
p_sys
->
i_outputfd
,
p_sys
->
output
.
p_begin
,
p_sys
->
output
.
i_length
);
if
(
i_len
==
-
1
)
{
/* We hit an error */
...
...
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