mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
rtpjitterbuffer: Remove raw comparisons of RTP sequence numbers
Several conditional statements perform comparison on RTP sequence numbers without taking the sequence number rollover into account. Instead, use the gst_rtp_buffer_compare_seqnum function to perform the comparison. https://bugzilla.gnome.org/show_bug.cgi?id=725159
This commit is contained in:
parent
1a91ab31d1
commit
6dd9142592
1 changed files with 7 additions and 3 deletions
|
@ -2008,7 +2008,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
|
||||||
type = TIMER_TYPE_LOST;
|
type = TIMER_TYPE_LOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (expected < seqnum) {
|
while (gst_rtp_buffer_compare_seqnum (expected, seqnum) > 0) {
|
||||||
add_timer (jitterbuffer, type, expected, 0, expected_dts, 0, duration);
|
add_timer (jitterbuffer, type, expected, 0, expected_dts, 0, duration);
|
||||||
expected_dts += duration;
|
expected_dts += duration;
|
||||||
expected++;
|
expected++;
|
||||||
|
@ -2859,7 +2859,9 @@ wait_next_timeout (GstRtpJitterBuffer * jitterbuffer)
|
||||||
} else if (timer_timeout == -1) {
|
} else if (timer_timeout == -1) {
|
||||||
/* we already have an immediate timeout, the new timer must be an
|
/* we already have an immediate timeout, the new timer must be an
|
||||||
* immediate timer with smaller seqnum to become the best */
|
* immediate timer with smaller seqnum to become the best */
|
||||||
if (test_timeout == -1 && test->seqnum < timer->seqnum)
|
if (test_timeout == -1
|
||||||
|
&& (gst_rtp_buffer_compare_seqnum (test->seqnum,
|
||||||
|
timer->seqnum) > 0))
|
||||||
save_best = TRUE;
|
save_best = TRUE;
|
||||||
} else if (test_timeout == -1) {
|
} else if (test_timeout == -1) {
|
||||||
/* first immediate timer */
|
/* first immediate timer */
|
||||||
|
@ -2867,7 +2869,9 @@ wait_next_timeout (GstRtpJitterBuffer * jitterbuffer)
|
||||||
} else if (test_timeout < timer_timeout) {
|
} else if (test_timeout < timer_timeout) {
|
||||||
/* earlier timer */
|
/* earlier timer */
|
||||||
save_best = TRUE;
|
save_best = TRUE;
|
||||||
} else if (test_timeout == timer_timeout && test->seqnum < timer->seqnum) {
|
} else if (test_timeout == timer_timeout
|
||||||
|
&& (gst_rtp_buffer_compare_seqnum (test->seqnum,
|
||||||
|
timer->seqnum) > 0)) {
|
||||||
/* same timer, smaller seqnum */
|
/* same timer, smaller seqnum */
|
||||||
save_best = TRUE;
|
save_best = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue