rtpjitterbuffer: rtp_jitter_buffer_calculate_pts should not reset in all cases (especially on (old) rtx packets)
While debugging some issues I noticed some strange behavior that happened occasionally. After attaching with gdb and continuing executing after a few seconds, I noticed that sometimes playback would resume and then shortly after completely be out-of-sync (permanently). I traced the problem to old rtx packets being processed, which erroneously caused it to trigger a resync to this old rtx packet due to "backward timestamps at server, schedule resync".
I fixed the issue by:
- Add a new argument
TRUEfor the "rtp delta too big, reset skew" and "backward timestamps at server, schedule resync" cases, then return
GST_CLOCK_TIME_NONEand do nothing. I believe the other resync cases need to be triggered regardless.
- Add a check for
!GST_CLOCK_TIME_IS_VALID (pts)to where
rtp_jitter_buffer_calculate_ptsis called, and in those cases do a
goto finished;to drop the packet.
This change appears to consistently fix playback after briefly pausing the process with gdb.