Skip to content

fix: report end of stream only after the last delivery has returned - #505

Merged
devopvoid merged 1 commit into
mainfrom
fix/pacer-drain-in-flight
Nov 1, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/pacer-drain-in-flight

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

The pacer takes an item out of its queue before handing it to WebRTC, so IsDrained() was already true while the last audio or video delivery was still running, and onEndOfStream() could fire before everything had been delivered. Applications closing a recorder or receiver on it would cut off the last chunk.

The pacer now counts deliveries in flight, and is drained only once its queues are empty and none are left. A new MediaPlayerTest holds the last deliveries in the audio sink and checks that the end of the stream is not reported meanwhile.

The pacer takes an item out of its queue before handing it to WebRTC, so empty queues alone made IsDrained() true while the last audio or video delivery was still running. Count deliveries in flight and drain only once none are left.
@devopvoid
devopvoid merged commit 0bb6c12 into main Nov 1, 2026
21 of 22 checks passed
@devopvoid
devopvoid deleted the fix/pacer-drain-in-flight branch November 1, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant