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
431e5dfa
Commit
431e5dfa
authored
Nov 27, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP: fail when object is killed
parent
627acb55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
modules/access/rtp/input.c
modules/access/rtp/input.c
+11
-16
No files found.
modules/access/rtp/input.c
View file @
431e5dfa
...
...
@@ -42,21 +42,20 @@
* @param fd datagram file descriptor
* @return a block or NULL on fatal error (socket dead)
*/
static
block_t
*
rtp_dgram_recv
(
int
fd
)
static
block_t
*
rtp_dgram_recv
(
vlc_object_t
*
obj
,
int
fd
)
{
block_t
*
block
=
block_Alloc
(
0xffff
);
ssize_t
len
;
do
{
struct
pollfd
ufd
=
{
.
fd
=
fd
,
.
events
=
POLLIN
,
};
block_cleanup_push
(
block
);
poll
(
&
ufd
,
1
,
-
1
);
len
=
recv
(
fd
,
block
->
p_buffer
,
block
->
i_buffer
,
0
);
len
=
net_Read
(
obj
,
fd
,
NULL
,
block
->
p_buffer
,
block
->
i_buffer
,
false
);
vlc_cleanup_pop
();
if
((
len
<=
0
)
&&
(
ufd
.
revents
&
POLLHUP
))
if
(((
len
<=
0
)
&&
poll
(
&
(
struct
pollfd
){
.
fd
=
fd
,
},
1
,
0
))
||
!
vlc_object_alive
(
obj
))
{
/* POLLHUP -> permanent (DCCP) socket error */
block_Release
(
block
);
return
NULL
;
...
...
@@ -73,19 +72,15 @@ static block_t *rtp_dgram_recv (int fd)
* @param fd stream file descriptor
* @return a block or NULL in case of fatal error
*/
static
block_t
*
rtp_stream_recv
(
int
fd
)
static
block_t
*
rtp_stream_recv
(
vlc_object_t
*
obj
,
int
fd
)
{
ssize_t
len
=
0
;
struct
pollfd
ufd
=
{
.
fd
=
fd
,
.
events
=
POLLIN
,
};
uint8_t
hdr
[
2
];
/* frame header */
/* Receives the RTP frame header */
do
{
ssize_t
val
;
poll
(
&
ufd
,
1
,
-
1
);
val
=
recv
(
fd
,
hdr
+
len
,
2
-
len
,
0
);
ssize_t
val
=
net_Read
(
obj
,
fd
,
NULL
,
hdr
+
len
,
2
-
len
,
false
);
if
(
val
<=
0
)
return
NULL
;
len
+=
val
;
...
...
@@ -100,8 +95,8 @@ static block_t *rtp_stream_recv (int fd)
ssize_t
val
;
block_cleanup_push
(
block
);
poll
(
&
ufd
,
1
,
-
1
);
val
=
recv
(
fd
,
block
->
p_buffer
+
i
,
block
->
i_buffer
-
i
,
0
);
val
=
net_Read
(
obj
,
fd
,
NULL
,
block
->
p_buffer
+
i
,
block
->
i_buffer
-
i
,
false
);
vlc_cleanup_pop
();
if
(
val
<=
0
)
...
...
@@ -123,8 +118,8 @@ static block_t *rtp_recv (demux_t *demux)
for
(
block_t
*
block
;;
block_Release
(
block
))
{
block
=
p_sys
->
framed_rtp
?
rtp_stream_recv
(
p_sys
->
fd
)
:
rtp_dgram_recv
(
p_sys
->
fd
);
?
rtp_stream_recv
(
VLC_OBJECT
(
demux
),
p_sys
->
fd
)
:
rtp_dgram_recv
(
VLC_OBJECT
(
demux
),
p_sys
->
fd
);
if
(
block
==
NULL
)
{
msg_Err
(
demux
,
"RTP flow stopped"
);
...
...
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