Repository navigation
fix(rtc): offload FFI handle disposal to thread in aclose and add sync close #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NabiBukhsh-AI
wants to merge
9
commits into
livekit:main
Choose a base branch
from
NabiBukhsh-AI:fix/832-audio-source-aclose-hang
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8ae5792
fix(rtc): offload FFI handle disposal to thread in aclose and add syn…
NabiBukhsh-AI c97bbf9
fix(rtc): handle cross-thread close, safe mock attributes, and isolat…
NabiBukhsh-AI 08e4deb
fix(rtc): dynamically bind active event loop in AudioSource to avoid …
NabiBukhsh-AI da44bea
fix(rtc): track capture generation in AudioSource to isolate clear_queue
NabiBukhsh-AI 6601c38
fix(rtc): synchronize audio source queue metrics with thread lock on …
NabiBukhsh-AI dcf6dcb
test(rtc): exit cleanly in ctypes array garbage test to avoid SIGABRT…
NabiBukhsh-AI c3ac4f6
fix(rtc): release the playout waiter thread-safely in AudioSource.aclose
NabiBukhsh-AI 280ef1c
fix(rtc): keep AudioSource playout tracking consistent across clear_q…
NabiBukhsh-AI c2cebf6
fix(rtc): read the playout future once in AudioSource.wait_for_playout
NabiBukhsh-AI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "livekit-rtc": patch | ||
| --- | ||
|
|
||
| `AudioSource.aclose()` and `VideoSource.aclose()` now dispose the native handle in a worker thread, so they no longer block the event loop, and both sources gain a synchronous `close()`. `AudioSource.close()`, `clear_queue()` and `asyncio.run(source.aclose())` can be called from another thread: a pending `wait_for_playout()` is released on the source's own loop, and audio captured after a `clear_queue()` keeps its own playout tracking. `wait_for_playout()` no longer returns early after the source moves to a new event loop. Capturing a frame after close is now a no-op. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.