mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +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,
|
GST_TRACE_OBJECT (dec,
|
||||||
"Trimming packets up to %" GST_TIME_FORMAT " (seq: %u)",
|
"Trimming packets up to %" GST_TIME_FORMAT " (seq: %u)",
|
||||||
GST_TIME_ARGS (GST_BUFFER_DTS_OR_PTS (item->buffer)), item->seq);
|
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",
|
D ? "row" : "column",
|
||||||
GST_TIME_ARGS (GST_BUFFER_DTS_OR_PTS (item->buffer)), item->seq);
|
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]),
|
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