mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine code to allow search for conflicts.
This commit is contained in:
parent
ead49e747b
commit
5d48c9ce1b
6 changed files with 27 additions and 27 deletions
|
@ -50,9 +50,9 @@ uint8_t srs_rtp_fast_parse_pt(char* buf, int size);
|
|||
srs_error_t srs_rtp_fast_parse_twcc(char* buf, int size, uint8_t twcc_id, uint16_t& twcc_sn);
|
||||
|
||||
// The "distance" between two uint16 number, for example:
|
||||
// distance(prev_value=3, value=5) === (int16_t)(uint16_t)((uint16_t)3-(uint16_t)5) === -2
|
||||
// distance(prev_value=3, value=65534) === (int16_t)(uint16_t)((uint16_t)3-(uint16_t)65534) === 5
|
||||
// distance(prev_value=65532, value=65534) === (int16_t)(uint16_t)((uint16_t)65532-(uint16_t)65534) === -2
|
||||
// distance(prev_value=3, value=5) is (int16_t)(uint16_t)((uint16_t)3-(uint16_t)5) is -2
|
||||
// distance(prev_value=3, value=65534) is (int16_t)(uint16_t)((uint16_t)3-(uint16_t)65534) is 5
|
||||
// distance(prev_value=65532, value=65534) is (int16_t)(uint16_t)((uint16_t)65532-(uint16_t)65534) is -2
|
||||
// For RTP sequence, it's only uint16 and may flip back, so 3 maybe 3+0xffff.
|
||||
// @remark Note that srs_rtp_seq_distance(0, 32768)>0 is TRUE by https://mp.weixin.qq.com/s/JZTInmlB9FUWXBQw_7NYqg
|
||||
// but for WebRTC jitter buffer it's FALSE and we follow it.
|
||||
|
|
|
@ -1849,7 +1849,7 @@ srs_error_t SrsMpegPES::decode_33bits_dts_pts(SrsBuffer* stream, int64_t* pv)
|
|||
}
|
||||
|
||||
// decode the 33bits schema.
|
||||
// ===========1B
|
||||
// --------------1B
|
||||
// 4bits const maybe '0001', '0010' or '0011'.
|
||||
// 3bits DTS/PTS [32..30]
|
||||
// 1bit const '1'
|
||||
|
@ -1864,7 +1864,7 @@ srs_error_t SrsMpegPES::decode_33bits_dts_pts(SrsBuffer* stream, int64_t* pv)
|
|||
}
|
||||
dts_pts_30_32 = (dts_pts_30_32 >> 1) & 0x07;
|
||||
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits DTS/PTS [29..15]
|
||||
// 1bit const '1'
|
||||
int64_t dts_pts_15_29 = stream->read_2bytes();
|
||||
|
@ -1873,7 +1873,7 @@ srs_error_t SrsMpegPES::decode_33bits_dts_pts(SrsBuffer* stream, int64_t* pv)
|
|||
}
|
||||
dts_pts_15_29 = (dts_pts_15_29 >> 1) & 0x7fff;
|
||||
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits DTS/PTS [14..0]
|
||||
// 1bit const '1'
|
||||
int64_t dts_pts_0_14 = stream->read_2bytes();
|
||||
|
|
|
@ -825,14 +825,14 @@ public:
|
|||
// presentation unit k of elementary stream n. The value of PTS is specified in units of the period of the system clock
|
||||
// frequency divided by 300 (yielding 90 kHz). The presentation time is derived from the PTS according to equation 2-11
|
||||
// below. Refer to 2.7.4 for constraints on the frequency of coding presentation timestamps.
|
||||
// ===========1B
|
||||
// --------------1B
|
||||
// 4bits const
|
||||
// 3bits PTS [32..30]
|
||||
// 1bit const '1'
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits PTS [29..15]
|
||||
// 1bit const '1'
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits PTS [14..0]
|
||||
// 1bit const '1'
|
||||
int64_t pts; // 33bits
|
||||
|
@ -841,14 +841,14 @@ public:
|
|||
// The DTS is a 33-bit number coded in three separate fields. It indicates the decoding time,
|
||||
// td n (j), in the system target decoder of an access unit j of elementary stream n. The value of DTS is specified in units of
|
||||
// the period of the system clock frequency divided by 300 (yielding 90 kHz).
|
||||
// ===========1B
|
||||
// --------------1B
|
||||
// 4bits const
|
||||
// 3bits DTS [32..30]
|
||||
// 1bit const '1'
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits DTS [29..15]
|
||||
// 1bit const '1'
|
||||
// ===========2B
|
||||
// --------------2B
|
||||
// 15bits DTS [14..0]
|
||||
// 1bit const '1'
|
||||
int64_t dts; // 33bits
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue