1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refactor code

This commit is contained in:
winlin 2020-05-19 17:49:34 +08:00
parent 23ddcbdaed
commit e3d010113f
5 changed files with 47 additions and 25 deletions

View file

@ -71,6 +71,13 @@ inline int16_t srs_rtp_seq_distance(const uint16_t& prev_value, const uint16_t&
return (int16_t)(value - prev_value);
}
// For map to compare the sequence of RTP.
struct SrsSeqCompareLess {
bool operator()(const uint16_t& pre_value, const uint16_t& value) const {
return srs_rtp_seq_distance(pre_value, value) > 0;
}
};
bool srs_seq_is_newer(uint16_t value, uint16_t pre_value);
bool srs_seq_is_roolback(uint16_t value, uint16_t pre_value);
int32_t srs_seq_distance(uint16_t value, uint16_t pre_value);