mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
ts/jitterbuffer: extra robustness for Windows CI
jitterbuffer tests crash on Windows CI sometimes. Activating logs showed time values which are probably not expected in a regular environment, but which can happen there. Adding extra robustness to `next_wakeup` computation seems to fix the problem judging by the few runs I triggered.
This commit is contained in:
parent
cc0ef5290f
commit
2355be1cef
1 changed files with 5 additions and 3 deletions
|
@ -872,9 +872,11 @@ impl SrcHandler {
|
|||
return (now, None);
|
||||
}
|
||||
|
||||
let next_wakeup = state
|
||||
.earliest_pts
|
||||
.map(|earliest_pts| earliest_pts + latency - state.packet_spacing - context_wait / 2);
|
||||
let next_wakeup = state.earliest_pts.map(|earliest_pts| {
|
||||
(earliest_pts + latency)
|
||||
.saturating_sub(state.packet_spacing)
|
||||
.saturating_sub(context_wait / 2)
|
||||
});
|
||||
|
||||
let delay = next_wakeup
|
||||
.opt_saturating_sub(now)
|
||||
|
|
Loading…
Reference in a new issue