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
b8ef158d
Commit
b8ef158d
authored
Feb 17, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP out: fix race condition in SDP generation from RTSP DESCRIBE
parent
2ed6e6a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+10
-6
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+1
-1
No files found.
modules/stream_out/rtp.c
View file @
b8ef158d
...
...
@@ -722,9 +722,9 @@ out:
* SDPGenerate
*****************************************************************************/
/*static*/
char
*
SDPGenerate
(
const
sout_stream_t
*
p_stream
,
const
char
*
rtsp_url
)
char
*
SDPGenerate
(
sout_stream_t
*
p_stream
,
const
char
*
rtsp_url
)
{
const
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
char
*
psz_sdp
;
struct
sockaddr_storage
dst
;
socklen_t
dstlen
;
...
...
@@ -746,11 +746,15 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
*/
int
inclport
;
vlc_mutex_lock
(
&
p_sys
->
lock_es
);
if
(
unlikely
(
p_sys
->
i_es
==
0
)
)
goto
out
;
/* hmm... */
if
(
p_sys
->
psz_destination
!=
NULL
)
{
inclport
=
1
;
/* Oh boy, this is really ugly!
(+ race condition on lock_es)
*/
/* Oh boy, this is really ugly! */
dstlen
=
sizeof
(
dst
);
if
(
p_sys
->
es
[
0
]
->
listen
.
fd
!=
NULL
)
getsockname
(
p_sys
->
es
[
0
]
->
listen
.
fd
[
0
],
...
...
@@ -780,7 +784,7 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
psz_sdp
=
vlc_sdp_Start
(
VLC_OBJECT
(
p_stream
),
SOUT_CFG_PREFIX
,
NULL
,
0
,
(
struct
sockaddr
*
)
&
dst
,
dstlen
);
if
(
psz_sdp
==
NULL
)
return
NULL
;
goto
out
;
/* TODO: a=source-filter */
if
(
p_sys
->
rtcp_mux
)
...
...
@@ -807,7 +811,6 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
}
}
/* FIXME: locking?! */
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
sout_stream_id_t
*
id
=
p_sys
->
es
[
i
];
...
...
@@ -854,7 +857,8 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
"SC:RTP%c"
,
toupper
(
mime_major
[
0
]
)
);
}
}
out:
vlc_mutex_unlock
(
&
p_sys
->
lock_es
);
return
psz_sdp
;
}
...
...
modules/stream_out/rtp.h
View file @
b8ef158d
...
...
@@ -36,7 +36,7 @@ void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t * );
char
*
RtspAppendTrackPath
(
rtsp_stream_id_t
*
id
,
const
char
*
base
);
char
*
SDPGenerate
(
const
sout_stream_t
*
p_stream
,
const
char
*
rtsp_url
);
char
*
SDPGenerate
(
sout_stream_t
*
p_stream
,
const
char
*
rtsp_url
);
uint32_t
rtp_compute_ts
(
const
sout_stream_id_t
*
id
,
int64_t
i_pts
);
int
rtp_add_sink
(
sout_stream_id_t
*
id
,
int
fd
,
bool
rtcp_mux
,
uint16_t
*
seq
);
...
...
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