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
2b7961e1
Commit
2b7961e1
authored
Aug 20, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code and remove unneeded tests.
parent
9e1c977b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
28 deletions
+11
-28
modules/mux/rtp/rtcp.c
modules/mux/rtp/rtcp.c
+11
-28
No files found.
modules/mux/rtp/rtcp.c
View file @
2b7961e1
...
@@ -64,8 +64,7 @@ static int SDES_client_item_del( rtcp_client_t *p_client )
...
@@ -64,8 +64,7 @@ static int SDES_client_item_del( rtcp_client_t *p_client )
rtcp_SDES_item_t
*
p_old
=
p_client
->
pp_sdes
[
i
];
rtcp_SDES_item_t
*
p_old
=
p_client
->
pp_sdes
[
i
];
REMOVE_ELEM
(
p_client
->
pp_sdes
,
p_client
->
i_items
,
i
);
REMOVE_ELEM
(
p_client
->
pp_sdes
,
p_client
->
i_items
,
i
);
p_client
->
i_items
--
;
p_client
->
i_items
--
;
if
(
p_old
->
psz_data
)
free
(
p_old
->
psz_data
);
free
(
p_old
->
psz_data
);
free
(
p_old
);
free
(
p_old
);
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -332,15 +331,12 @@ static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -332,15 +331,12 @@ static int rtcp_decode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
rtcp_client_t
*
p_client
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
uint32_t
i_pos
=
0
;
uint32_t
i_pos
=
0
;
uint32_t
u_ssrc
=
0
;
uint32_t
u_ssrc
=
0
;
int
result
=
0
;
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
result
=
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
result
=
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
vlc_object_lock
(
p_rtcp
);
vlc_object_lock
(
p_rtcp
);
...
@@ -400,15 +396,12 @@ static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -400,15 +396,12 @@ static int rtcp_decode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
rtcp_client_t
*
p_client
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
uint32_t
i_pos
=
0
;
uint32_t
i_pos
=
0
;
uint32_t
u_ssrc
=
0
;
uint32_t
u_ssrc
=
0
;
int
result
=
0
;
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
result
=
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
result
=
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
...
@@ -466,15 +459,12 @@ static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -466,15 +459,12 @@ static int rtcp_decode_SDES( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
uint8_t
u_item
=
0
;
uint8_t
u_item
=
0
;
uint8_t
u_length
=
0
;
uint8_t
u_length
=
0
;
int
i
=
0
;
int
i
=
0
;
int
result
=
0
;
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
result
=
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
result
=
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
...
@@ -580,7 +570,6 @@ static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -580,7 +570,6 @@ static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
uint32_t
u_ssrc
=
0
;
uint32_t
u_ssrc
=
0
;
uint32_t
i_pos
=
0
;
uint32_t
i_pos
=
0
;
uint32_t
i
=
0
;
uint32_t
i
=
0
;
int
result
=
0
;
if
(
!
p_pkt
)
if
(
!
p_pkt
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -589,11 +578,9 @@ static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -589,11 +578,9 @@ static int rtcp_decode_APP( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
u_ssrc
=
bs_read
(
p_rtcp
->
bs
,
32
);
result
=
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
result
=
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_add_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
...
@@ -823,7 +810,6 @@ block_t *rtcp_encode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -823,7 +810,6 @@ block_t *rtcp_encode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
rtcp_stats_t
*
p_stats
=
NULL
;
rtcp_stats_t
*
p_stats
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
uint32_t
i_pos
=
0
;
uint32_t
i_pos
=
0
;
int
result
=
0
;
if
(
p_pkt
->
u_payload_type
!=
RTCP_SR
)
if
(
p_pkt
->
u_payload_type
!=
RTCP_SR
)
return
NULL
;
return
NULL
;
...
@@ -858,8 +844,7 @@ block_t *rtcp_encode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -858,8 +844,7 @@ block_t *rtcp_encode_SR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
bs_write
(
s
,
32
,
p_pkt
->
report
.
sr
.
u_octet_count
);
bs_write
(
s
,
32
,
p_pkt
->
report
.
sr
.
u_octet_count
);
/* report block */
/* report block */
result
=
p_rtcp
->
pf_find_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
msg_Err
(
p_this
,
"SR: SSRC identifier doesn't exists"
,
p_pkt
->
u_ssrc
);
msg_Err
(
p_this
,
"SR: SSRC identifier doesn't exists"
,
p_pkt
->
u_ssrc
);
free
(
p_block
);
free
(
p_block
);
...
@@ -898,7 +883,6 @@ block_t *rtcp_encode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -898,7 +883,6 @@ block_t *rtcp_encode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
rtcp_stats_t
*
p_stats
=
NULL
;
rtcp_stats_t
*
p_stats
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
rtcp_client_t
*
p_client
=
NULL
;
uint32_t
i_pos
=
0
;
uint32_t
i_pos
=
0
;
int
result
=
0
;
if
(
p_pkt
->
u_payload_type
!=
RTCP_RR
)
if
(
p_pkt
->
u_payload_type
!=
RTCP_RR
)
return
NULL
;
return
NULL
;
...
@@ -919,8 +903,7 @@ block_t *rtcp_encode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
...
@@ -919,8 +903,7 @@ block_t *rtcp_encode_RR( vlc_object_t *p_this, rtcp_pkt_t *p_pkt )
bs_write
(
s
,
32
,
p_pkt
->
u_ssrc
);
bs_write
(
s
,
32
,
p_pkt
->
u_ssrc
);
/* report block */
/* report block */
result
=
p_rtcp
->
pf_find_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
);
if
(
p_rtcp
->
pf_find_client
(
p_this
,
p_pkt
->
u_ssrc
,
&
i_pos
)
==
VLC_EGENERIC
)
if
(
result
==
VLC_EGENERIC
)
{
{
msg_Err
(
p_this
,
"RR: SSRC identifier doesn't exists"
,
p_pkt
->
u_ssrc
);
msg_Err
(
p_this
,
"RR: SSRC identifier doesn't exists"
,
p_pkt
->
u_ssrc
);
free
(
p_block
);
free
(
p_block
);
...
...
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