-
-
Notifications
You must be signed in to change notification settings - Fork 51
Introduce ComposeThread for improved audio composition handling #1435
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
Conversation
|
No TODO comments were found. |
Minimum allowed line rate is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a new ComposeThread class to manage audio composition tasks on a dedicated thread, following the same pattern as the existing RenderThread for graphics operations. The key changes include:
- A new
ComposeThreadstatic class with a dedicatedDispatcherand reactiveScheduler - Updates to
PlayerViewModelto execute audio composition on theComposeThread - Updates to
SampleProviderImplto ensure thread-safe audio composition operations - A change in
OutputViewModelfrom usingRenderThread.Dispatcher.InvokeAsynctoTask.Run
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Beutl.Engine/Audio/Composing/ComposeThread.cs | New dedicated thread class for audio composition, mirrors RenderThread pattern with Dispatcher and custom LocalScheduler |
| src/Beutl/ViewModels/PlayerViewModel.cs | Updated FillAudioData to wrap audio composition in ComposeThread.Dispatcher.Invoke for thread safety |
| src/Beutl/Models/SampleProviderImpl.cs | Refactored Sample method to check thread access and dispatch to ComposeThread, ensuring all composition happens on dedicated thread |
| src/Beutl/ViewModels/Tools/OutputViewModel.cs | Changed encoding startup from RenderThread.Dispatcher.InvokeAsync to Task.Run, moving coordination to thread pool |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Description
Add a new
ComposeThreadclass to manage audio composition tasks on a dedicated thread, enhancing performance and responsiveness. Update existing audio processing methods to utilize the new dispatcher for thread-safe operations.Breaking changes
No breaking changes introduced.
Fixed issues
No specific issues fixed.