RTP Stream Dialog: Actually sort on packet loss

The packet loss column has been sorting on a private variable
that is never set(?!) and also is unsigned whereas the actual
lost number is signed. Get the calculated packet loss number
and sort by that. (Should this be sorting by the total number or
the percentage, since the column displays both? Total number is
first so let's use that.)

This should probably be some kind of Model/View instead.

Fix #16785.
This commit is contained in:
John Thacker 2023-02-04 22:09:22 -05:00
parent 8cddc32d35
commit 4bb43d5986
1 changed files with 7 additions and 2 deletions

View File

@ -229,7 +229,13 @@ public:
case packets_col_:
return stream_info_->packet_count < other_rstwi.stream_info_->packet_count;
case lost_col_:
return lost_ < other_rstwi.lost_;
rtpstream_info_calculate(stream_info_, &calc1);
rtpstream_info_calculate(other_rstwi.stream_info_, &calc2);
/* XXX: Should this sort on the total number or the percentage?
* lost_num is displayed first and lost_perc in parenthesis,
* so let's use the total number.
*/
return calc1.lost_num < calc2.lost_num;
case min_delta_col_:
return stream_info_->rtp_stats.min_delta < other_rstwi.stream_info_->rtp_stats.min_delta;
case mean_delta_col_:
@ -257,7 +263,6 @@ public:
private:
rtpstream_info_t *stream_info_;
guint32 lost_;
gboolean tod_;
};