Commit graph

5 commits

Author SHA1 Message Date
Nicolas Dufresne
5b2ad31583 rtptimerqueue: Fix leak on timer collision
While the caller should make sure this does not happen, make sure timer
collision are not silently ignored and leaked.

Fixes #726

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/616>
2020-06-08 17:54:53 -04:00
Havard Graff
a710bda1ab rtptimerqueue: remove ->num from the timer
This concept was only used by the "multi"-lost timer, and since that
one is not around any longer, the "num" concept is superfluous.
2020-03-20 13:17:20 +00:00
Sebastian Dröge
3998b7cb4c rtpjitterbuffer: Include string.h for memcpy() / memset()
Usually something else is pulling it in somehow already, but not on
Windows.
2020-02-25 09:07:47 +00:00
Nicolas Dufresne
af1c586c7b rtptimerqueue: Optimize reschedule optations
This basically add ability to choose between inserting from head, tail
or in-place in order to try and minimize the distance to walk through in
the timer queue. This removes an overhead we had seen on high drop rate.
2019-09-27 17:34:04 -04:00
Nicolas Dufresne
37742cd36d rtptimerqueue: Consolidate a data structure for timers
Implement a single timer queue for all timers. The goal is to always use
ordered queues for storing timers. This way, extracting timers for
execution becomes O(1). This also allow separating the clock wait
scheduling from the timer itself and ensure that we only wake up the
timer thread when strictly needed.

The knew data structure is still O(n) on insertions and reschedule,
but we now use proximity optimization so that normal cases should be
really fast. The GList structure is also embeded intot he RtpTimer
structure to reduce the number of allocations.
2019-09-27 17:34:04 -04:00