Skip to content

Commit 188d2e6

Browse files
authored
Only access oboe stream if it is alive when firing error callback
Fixes #2321
1 parent 145613f commit 188d2e6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/aaudio/AudioStreamAAudio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ void AudioStreamAAudio::internalErrorCallback(
232232
LOGD("%s() ErrorTimeout changed to ErrorDisconnected to fix b/173928197", __func__);
233233
}
234234

235-
oboeStream->mErrorCallbackResult = oboeResult;
236-
237235
// Prevents deletion of the stream if the app is using AudioStreamBuilder::openStream(shared_ptr)
238236
auto [isStreamAlive, sharedStream] =
239237
AAudioStreamCollection::getInstance().getStream(oboeStream);
@@ -242,6 +240,8 @@ void AudioStreamAAudio::internalErrorCallback(
242240
return;
243241
}
244242

243+
oboeStream->mErrorCallbackResult = oboeResult;
244+
245245
// These checks should be enough because we assume that the stream close()
246246
// will join() any active callback threads and will not allow new callbacks.
247247
if (oboeStream->wasErrorCallbackCalled()) { // block extra error callbacks

0 commit comments

Comments
 (0)