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
a35051d3
Commit
a35051d3
authored
May 26, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtp sout: move ES port number initialization
They are only ever used if there is an explicit dst
parent
2c58eea1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
31 deletions
+33
-31
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+33
-31
No files found.
modules/stream_out/rtp.c
View file @
a35051d3
...
@@ -913,36 +913,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -913,36 +913,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
return
NULL
;
return
NULL
;
}
}
/* Choose the port */
uint16_t
i_port
=
0
;
if
(
p_fmt
==
NULL
)
;
else
if
(
p_fmt
->
i_cat
==
AUDIO_ES
&&
p_sys
->
i_port_audio
>
0
)
i_port
=
p_sys
->
i_port_audio
;
else
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
p_sys
->
i_port_video
>
0
)
i_port
=
p_sys
->
i_port_video
;
/* We do not need the ES lock (p_sys->lock_es) here, because this is the
* only one thread that can *modify* the ES table. The ES lock protects
* the other threads from our modifications (TAB_APPEND, TAB_REMOVE). */
for
(
int
i
=
0
;
i_port
&&
(
i
<
p_sys
->
i_es
);
i
++
)
if
(
i_port
==
p_sys
->
es
[
i
]
->
i_port
)
i_port
=
0
;
/* Port already in use! */
for
(
uint16_t
p
=
p_sys
->
i_port
;
i_port
==
0
;
p
+=
2
)
{
if
(
p
==
0
)
{
msg_Err
(
p_stream
,
"too many RTP elementary streams"
);
return
NULL
;
}
i_port
=
p
;
for
(
int
i
=
0
;
i_port
&&
(
i
<
p_sys
->
i_es
);
i
++
)
if
(
p
==
p_sys
->
es
[
i
]
->
i_port
)
i_port
=
0
;
}
sout_stream_id_t
*
id
=
malloc
(
sizeof
(
*
id
)
);
sout_stream_id_t
*
id
=
malloc
(
sizeof
(
*
id
)
);
if
(
unlikely
(
id
==
NULL
)
)
if
(
unlikely
(
id
==
NULL
)
)
return
NULL
;
return
NULL
;
...
@@ -959,7 +929,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -959,7 +929,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id
->
psz_fmtp
=
NULL
;
id
->
psz_fmtp
=
NULL
;
id
->
i_clock_rate
=
90000
;
/* most common case for video */
id
->
i_clock_rate
=
90000
;
/* most common case for video */
id
->
i_channels
=
0
;
id
->
i_channels
=
0
;
id
->
i_port
=
i_port
;
if
(
p_fmt
!=
NULL
)
if
(
p_fmt
!=
NULL
)
{
{
id
->
i_cat
=
p_fmt
->
i_cat
;
id
->
i_cat
=
p_fmt
->
i_cat
;
...
@@ -1025,6 +994,39 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
...
@@ -1025,6 +994,39 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
if
(
p_sys
->
psz_destination
!=
NULL
)
if
(
p_sys
->
psz_destination
!=
NULL
)
{
{
/* Choose the port */
uint16_t
i_port
=
0
;
if
(
p_fmt
==
NULL
)
;
else
if
(
p_fmt
->
i_cat
==
AUDIO_ES
&&
p_sys
->
i_port_audio
>
0
)
i_port
=
p_sys
->
i_port_audio
;
else
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
p_sys
->
i_port_video
>
0
)
i_port
=
p_sys
->
i_port_video
;
/* We do not need the ES lock (p_sys->lock_es) here, because
* this is the only one thread that can *modify* the ES table.
* The ES lock protects the other threads from our modifications
* (TAB_APPEND, TAB_REMOVE). */
for
(
int
i
=
0
;
i_port
&&
(
i
<
p_sys
->
i_es
);
i
++
)
if
(
i_port
==
p_sys
->
es
[
i
]
->
i_port
)
i_port
=
0
;
/* Port already in use! */
for
(
uint16_t
p
=
p_sys
->
i_port
;
i_port
==
0
;
p
+=
2
)
{
if
(
p
==
0
)
{
msg_Err
(
p_stream
,
"too many RTP elementary streams"
);
goto
error
;
}
i_port
=
p
;
for
(
int
i
=
0
;
i_port
&&
(
i
<
p_sys
->
i_es
);
i
++
)
if
(
p
==
p_sys
->
es
[
i
]
->
i_port
)
i_port
=
0
;
}
id
->
i_port
=
i_port
;
int
type
=
SOCK_STREAM
;
int
type
=
SOCK_STREAM
;
switch
(
p_sys
->
proto
)
switch
(
p_sys
->
proto
)
...
...
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