module-rtp: Account for in-flight samples in RTP receive

When not using PTP as the driver, it is possible that packet receive and
the process() callback are out of sync, meaning that the target buffer
fill level might be off by upto one ptime's worth of samples
occasionally. This would make the DLL hunt for the target rate, and
cause a constantly varying delay.

Accounting for the delta between the packet receive time and the
process() time allows us to eliminate this jitter, resulting in much
more consistent rate matching.
This commit is contained in:
Arun Raghavan 2024-11-26 13:18:24 -05:00 committed by Wim Taymans
parent e76e057038
commit 45eee02a99
2 changed files with 16 additions and 1 deletions

View file

@ -75,6 +75,7 @@ struct impl {
struct spa_ringbuffer ring;
uint8_t buffer[BUFFER_SIZE];
uint64_t last_recv_timestamp;
struct spa_io_rate_match *io_rate_match;
struct spa_io_position *io_position;