Commit 4f93003c authored by Simon Morlat's avatar Simon Morlat

fix values for late and loss rates returned to be as percentage.

parent abf2a7ec
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment