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
54e03ff6
Commit
54e03ff6
authored
Jul 26, 2013
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpproto: Support nonblocking reads
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
2e814d03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
rtpproto.c
libavformat/rtpproto.c
+4
-1
No files found.
libavformat/rtpproto.c
View file @
54e03ff6
...
...
@@ -326,12 +326,13 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
socklen_t
from_len
;
int
len
,
n
;
struct
pollfd
p
[
2
]
=
{{
s
->
rtp_fd
,
POLLIN
,
0
},
{
s
->
rtcp_fd
,
POLLIN
,
0
}};
int
poll_delay
=
h
->
flags
&
AVIO_FLAG_NONBLOCK
?
0
:
100
;
for
(;;)
{
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
/* build fdset to listen to RTP and RTCP packets */
n
=
poll
(
p
,
2
,
100
);
n
=
poll
(
p
,
2
,
poll_delay
);
if
(
n
>
0
)
{
/* first try RTCP */
if
(
p
[
1
].
revents
&
POLLIN
)
{
...
...
@@ -368,6 +369,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
continue
;
return
AVERROR
(
EIO
);
}
if
(
h
->
flags
&
AVIO_FLAG_NONBLOCK
)
return
AVERROR
(
EAGAIN
);
}
return
len
;
}
...
...
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