Skip to content

Commit e618964

Browse files
committed
fix: delayed str0m loop
1 parent f5b50b2 commit e618964

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pulsebeam/src/participant/core.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ impl ParticipantCore {
199199
/// The Main Orchestrator.
200200
/// Drives the feedback loop between the RTC Engine and the Signaling Logic.
201201
pub fn poll(&mut self) -> Option<Instant> {
202+
while let Some(deadline) = self.poll_inner() {
203+
if deadline > Instant::now() {
204+
return Some(deadline);
205+
}
206+
// Deadline already expired — advance str0m's timer so it fires,
207+
// then poll_inner() on the next iteration drains the new output.
208+
let _ = self.rtc.handle_input(Input::Timeout(Instant::now().into()));
209+
}
210+
None
211+
}
212+
213+
pub fn poll_inner(&mut self) -> Option<Instant> {
202214
let now = Instant::now();
203215

204216
if now >= self.last_slow_poll + SLOW_POLL_INTERVAL {

0 commit comments

Comments
 (0)