Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
54e03ff6
Commit
54e03ff6
authored
11 years ago
by
Martin Storsjö
Browse files
Options
Downloads
Patches
Plain Diff
rtpproto: Support nonblocking reads
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
2e814d03
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/rtpproto.c
+4
-1
4 additions, 1 deletion
libavformat/rtpproto.c
with
4 additions
and
1 deletion
libavformat/rtpproto.c
+
4
−
1
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment