refine the time jitter code.
This commit is contained in:
parent
1f1776a0d8
commit
8e8c8108fc
|
|
@ -92,7 +92,7 @@ int SrsRtmpJitter::correct(SrsSharedPtrMessage* msg, int tba, int tbv, SrsRtmpJi
|
||||||
if (ag == SrsRtmpJitterAlgorithmZERO) {
|
if (ag == SrsRtmpJitterAlgorithmZERO) {
|
||||||
// for the first time, last_pkt_correct_time is zero.
|
// for the first time, last_pkt_correct_time is zero.
|
||||||
// while when timestamp overflow, the timestamp become smaller, reset the last_pkt_correct_time.
|
// while when timestamp overflow, the timestamp become smaller, reset the last_pkt_correct_time.
|
||||||
if (last_pkt_correct_time <= 0 || last_pkt_correct_time > msg->timestamp) {
|
if (last_pkt_correct_time <= 0 || msg->timestamp < last_pkt_correct_time) {
|
||||||
last_pkt_correct_time = msg->timestamp;
|
last_pkt_correct_time = msg->timestamp;
|
||||||
}
|
}
|
||||||
msg->timestamp -= last_pkt_correct_time;
|
msg->timestamp -= last_pkt_correct_time;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user