Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
4f93003c
Commit
4f93003c
authored
Apr 09, 2013
by
Simon Morlat
Browse files
fix values for late and loss rates returned to be as percentage.
parent
abf2a7ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
include/mediastreamer2/qualityindicator.h
include/mediastreamer2/qualityindicator.h
+3
-1
src/voip/qualityindicator.c
src/voip/qualityindicator.c
+5
-2
No files found.
include/mediastreamer2/qualityindicator.h
View file @
4f93003c
...
...
@@ -59,12 +59,14 @@ MS2_PUBLIC float ms_quality_indicator_get_average_rating(MSQualityIndicator *qi)
/**
* Returns the local loss rate, as computed internally by ms_quality_indicator_update_local().
* The value is expressed as a percentage.
* This method is for advanced usage.
**/
MS2_PUBLIC
float
ms_quality_indicator_get_local_loss_rate
(
const
MSQualityIndicator
*
qi
);
/**
* Returns the local late rate, as computed internally by ms_quality_indicator_update_local().
* Returns the local late rate, as computed internally by ms_quality_indicator_update_local().
* The value is expressed as a percentage.
* This method is for advanced usage.
**/
MS2_PUBLIC
float
ms_quality_indicator_get_local_late_rate
(
const
MSQualityIndicator
*
qi
);
...
...
src/voip/qualityindicator.c
View file @
4f93003c
...
...
@@ -142,8 +142,11 @@ void ms_quality_indicator_update_local(MSQualityIndicator *qi){
if
(
lost
<
0
)
lost
=
0
;
/* will be the case at least the first time, because we don't know the initial sequence number*/
if
(
late
<
0
)
late
=
0
;
qi
->
cur_loss_rate
=
loss_rate
=
(
float
)
lost
/
(
float
)
recvcnt
;
qi
->
cur_late_rate
=
late_rate
=
(
float
)
late
/
(
float
)
recvcnt
;
loss_rate
=
(
float
)
lost
/
(
float
)
recvcnt
;
qi
->
cur_loss_rate
=
loss_rate
*
100
.
0
;
late_rate
=
(
float
)
late
/
(
float
)
recvcnt
;
qi
->
cur_late_rate
=
late_rate
*
100
.
0
;
qi
->
local_rating
=
compute_rating
(
loss_rate
,
0
,
late_rate
,
rtp_session_get_round_trip_propagation
(
qi
->
session
));
update_global_rating
(
qi
);
...
...
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