You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the AAudio API AudioStream::setBufferSizeInFrames is a wrapper for AAudioStream_setBufferSizeInFrames which returns an int. On success the int contains the new buffer size or on error contains a negative error number. This int is cast to an oboe::Result.
This represents a problem because in order to check whether the call was successful one must cast the oboe::Result back to an int and check whether it's negative. This breaks the pattern of doing if (result == Result::OK)
We should update setBufferSizeInFrames to return an oboe::ErrorOrValue
The text was updated successfully, but these errors were encountered:
https://github.com/google/oboe/blob/master/src/aaudio/AudioStreamAAudio.cpp#L320
When using the AAudio API
AudioStream::setBufferSizeInFrames
is a wrapper forAAudioStream_setBufferSizeInFrames
which returns anint
. On success the int contains the new buffer size or on error contains a negative error number. Thisint
is cast to anoboe::Result
.This represents a problem because in order to check whether the call was successful one must cast the
oboe::Result
back to anint
and check whether it's negative. This breaks the pattern of doingif (result == Result::OK)
We should update
setBufferSizeInFrames
to return anoboe::ErrorOrValue
The text was updated successfully, but these errors were encountered: