st2022-1-fecdec: fix packet trimming
authorMathieu Duponchelle <mathieu@centricular.com>
Fri, 12 Nov 2021 02:17:44 +0000 (03:17 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 12 Nov 2021 08:15:28 +0000 (08:15 +0000)
commit792fb05cecce378ca03a4e4b5b1ea548a034d15f
treecbf8c2cad92729493599c3165758aba5d9ae1aad
parentd2fd5f1534bba5e28934c8a2161e02f8bbdf73e8
st2022-1-fecdec: fix packet trimming

g_sequence_remove_range's end iter is exclusive, so if one
wants to remove that item as well, it should be called with
the next iter.

This could in theory fix an issue where:

* The sequence isn't entirely trimmed, with an old item lingering

* Following FEC packets are immediately discarded because they
  arrived later than corresponding media packets, long enough for
  seqnums to wrap around

* We now try to reconstruct a media packet with a completely obsolete
  FEC packet, chaos ensues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1341>
subprojects/gst-plugins-good/gst/rtpmanager/gstrtpst2022-1-fecdec.c