mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 09:25:42 +00:00
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>
This commit is contained in:
parent
d2fd5f1534
commit
792fb05cec
1 changed files with 3 additions and 2 deletions
|
@ -221,7 +221,8 @@ trim_items (GstRTPST_2022_1_FecDec * dec)
|
|||
GST_TRACE_OBJECT (dec,
|
||||
"Trimming packets up to %" GST_TIME_FORMAT " (seq: %u)",
|
||||
GST_TIME_ARGS (GST_BUFFER_DTS_OR_PTS (item->buffer)), item->seq);
|
||||
g_sequence_remove_range (g_sequence_get_begin_iter (dec->packets), iter);
|
||||
g_sequence_remove_range (g_sequence_get_begin_iter (dec->packets),
|
||||
g_sequence_iter_next (iter));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +264,7 @@ trim_fec_items (GstRTPST_2022_1_FecDec * dec, guint D)
|
|||
D ? "row" : "column",
|
||||
GST_TIME_ARGS (GST_BUFFER_DTS_OR_PTS (item->buffer)), item->seq);
|
||||
g_sequence_remove_range (g_sequence_get_begin_iter (dec->fec_packets[D]),
|
||||
iter);
|
||||
g_sequence_iter_next (iter));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue