Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
63afc4f6
Commit
63afc4f6
authored
Mar 15, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udp: use non-blocking read instead of select.
parent
aa129788
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
20 deletions
+1
-20
udp.c
libavformat/udp.c
+1
-20
No files found.
libavformat/udp.c
View file @
63afc4f6
...
...
@@ -327,33 +327,14 @@ static void *circular_buffer_task( void *_URLContext)
{
URLContext
*
h
=
_URLContext
;
UDPContext
*
s
=
h
->
priv_data
;
fd_set
rfds
;
struct
timeval
tv
;
int
old_cancelstate
;
pthread_setcancelstate
(
PTHREAD_CANCEL_DISABLE
,
&
old_cancelstate
);
ff_socket_nonblock
(
s
->
udp_fd
,
0
);
while
(
1
)
{
int
left
;
int
ret
;
int
len
;
FD_ZERO
(
&
rfds
);
FD_SET
(
s
->
udp_fd
,
&
rfds
);
tv
.
tv_sec
=
1
;
tv
.
tv_usec
=
0
;
pthread_setcancelstate
(
PTHREAD_CANCEL_ENABLE
,
&
old_cancelstate
);
ret
=
select
(
s
->
udp_fd
+
1
,
&
rfds
,
NULL
,
NULL
,
&
tv
);
pthread_setcancelstate
(
PTHREAD_CANCEL_DISABLE
,
&
old_cancelstate
);
if
(
ret
<
0
)
{
if
(
ff_neterrno
()
==
AVERROR
(
EINTR
))
continue
;
s
->
circular_buffer_error
=
AVERROR
(
EIO
);
goto
end
;
}
if
(
!
(
ret
>
0
&&
FD_ISSET
(
s
->
udp_fd
,
&
rfds
)))
continue
;
/* How much do we have left to the end of the buffer */
/* Whats the minimum we can read so that we dont comletely fill the buffer */
left
=
av_fifo_space
(
s
->
fifo
);
...
...
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