mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
rtpstats: guard against division by zero
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/646>
This commit is contained in:
parent
e45cc475bd
commit
57eebe8b05
1 changed files with 6 additions and 4 deletions
|
@ -622,10 +622,12 @@ rtp_twcc_stats_calculate_windowed_stats (RTPTWCCStats * stats)
|
|||
stats->avg_delta_of_delta = avg_delta_of_delta;
|
||||
}
|
||||
|
||||
stats->bitrate_sent =
|
||||
gst_util_uint64_scale (bits_sent, GST_SECOND, local_duration);
|
||||
stats->bitrate_recv =
|
||||
gst_util_uint64_scale (bits_recv, GST_SECOND, remote_duration);
|
||||
if (local_duration > 0)
|
||||
stats->bitrate_sent =
|
||||
gst_util_uint64_scale (bits_sent, GST_SECOND, local_duration);
|
||||
if (remote_duration > 0)
|
||||
stats->bitrate_recv =
|
||||
gst_util_uint64_scale (bits_recv, GST_SECOND, remote_duration);
|
||||
|
||||
GST_DEBUG ("Got stats: bits_sent: %u, bits_recv: %u, packets_sent = %u, "
|
||||
"packets_recv: %u, packetlost_pct = %f, sent_bitrate = %u, "
|
||||
|
|
Loading…
Reference in a new issue