twcc: Better handle duplicate packets
authorEdward Hervey <edward@centricular.com>
Tue, 4 Apr 2023 07:21:47 +0000 (09:21 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 10 Apr 2023 12:16:44 +0000 (13:16 +0100)
commit75a550a1b10872fcb5639784bf3ebea281eec7a8
tree392f9949b5711ce45e95f195894e1e4aafd94a76
parent5f17cb9f3df5cf8450051ebfe6c343e076c1ab5d
twcc: Better handle duplicate packets

The previous code would only check if two packets in a row were duplicates. If
not (i.e. a packet is a duplicate of a packet received slightly before) the code
would generate completely bogus FCI because it assumes there were no duplicates
present in the array.

In order to be efficient, just store all received packets and remove the
duplicates just before the FCI is generated once the array of observations have
been sorted by seqnum.

Fixes TWCC usage with moderate to high packet duplication.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4378>
subprojects/gst-plugins-good/gst/rtpmanager/rtptwcc.c
subprojects/gst-plugins-good/tests/check/elements/rtpsession.c