-
Notifications
You must be signed in to change notification settings - Fork 90
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
Possible race condition in SFBAudioPlayer
when creating new _playerNode
#548
Comments
I believe a similar bug exists in AudioPlayerNode in all methods accessing the current decoder. For example: SFBAudioEngine/Sources/CSFBAudioEngine/Player/AudioPlayerNode.mm Lines 457 to 476 in e18876e
After the |
I believe you're right. A lock isn't an option because of usage in the IOProc but additional synchronization is probably needed. |
Ah yes indeed. I would argue that the render block should not fiddle with the decoder states and only report how many frames were rendered. Let the current decoder thread handle the frame accounting. |
Since
_playerNode
may be swapped out in-configureProcessingGraphForFormat:forceUpdate:
, there is a small chance that it could benil
when used in one of the otherSFBAudioPlayer
methods (e.g.-playbackPosition
) if that method is called between the time_playerNode
is set tonil
and reassigned.SFBAudioEngine/Sources/CSFBAudioEngine/Player/SFBAudioPlayer.mm
Line 946 in 02fa6a4
SFBAudioEngine/Sources/CSFBAudioEngine/Player/SFBAudioPlayer.mm
Line 447 in 02fa6a4
SFBAudioEngine/Sources/CSFBAudioEngine/Player/SFBAudioPlayer.mm
Line 949 in 02fa6a4
The current implementation takes advantage of the fact that in Objective-C messaging
nil
isn't an error but the potential for incorrect behavior exists.The text was updated successfully, but these errors were encountered: