-
Notifications
You must be signed in to change notification settings - Fork 163
Fix audio processing delegate lifecycle #784
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
|
|
| set { | ||
| capturePostProcessingDelegateAdapter.set(target: newValue) | ||
| capturePostProcessingDelegateSubject.send(newValue) | ||
| public weak var capturePostProcessingDelegate: AudioCustomProcessingDelegate? { |
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.
do we really need to set it weak ? or we make sure it will be set to nil when AudioRenderer get removed from the track ?
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.
I generally agree with this comment as posted elsewhere, for delegates it's the "default" approach, but for "top-down" ownership model (no cycles) we should use weak sparingly.
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.
Either option works for me, as long as we’re okay with having inconsistencies related to the delegate weakness in the SDK, since anything using MulticastDelegate is weak now, e.g. room.add(delegate:), AudioManager.shared.add(localAudioRenderer:), etc.
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.
Unfortunately I don't see any option to "automate" it e.g. via swiftlint as every use case is vastly different and must be evaluated separately 😿
xianshijing-lk
left a comment
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.
one nit, I am OK with the change if you think weak is better
|
Hmm... looks like something broke with this PR 😢 |
#784 Broke `LocalAudioTrack.add(audioRenderer: AudioRenderer)` so this PR fixes it...
No description provided.