-
Notifications
You must be signed in to change notification settings - Fork 573
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
oboe: stop stream if callback requests it #323
Conversation
Stop in a separate thread for AAudio before Q. Call stop directly for OpenSL ES. Possible fix for #277
src/aaudio/AudioStreamAAudio.cpp
Outdated
@@ -263,6 +282,7 @@ Result AudioStreamAAudio::requestStart() { | |||
return Result::OK; | |||
} | |||
} | |||
setDataCallbackEnabled(true); |
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 don't get this - why is dataCallbackEnabled always set to true? what about stream which use nonblocking read/writes?
|
||
setDataCallbackEnabled(true); |
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.
As previous comment. Not sure why the stream should always be using callbacks.
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.
Enabled just means it is not disabled. It does not mean it will be used. But that is confusing. I will clarify or modify the code.
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 cleaned up the enable and also refactored requestStart for OpenSL ES.
src/opensles/AudioStreamOpenSLES.cpp
Outdated
} | ||
if (stopStream) { | ||
requestStop(); | ||
// launchStopThread(); |
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.
Commented out code
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.
Thanks. I removed it.
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.
Couple of questions and a minor suggestion
Simplify locking in OpenSL requestStart.
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.
LGTM. The only other method name I considered was isCapableOfCallbacks
but it's a bit of a mouthful and doesn't add much.
Fixes #61 |
Sorry, your question slipped through the net... You should still be able to use You can stop the stream at any time by calling Please open a new issue referencing this one if you're still experiencing problems. |
Additionally, you can check the result of |
Stop in a separate thread for AAudio before Q.
Call stop directly for OpenSL ES.
Possible fix for #277