Fail out of loop in callback if suspended
parent
b84d760972
commit
8c6cc6ba4c
|
@ -244,9 +244,11 @@ static void opensles_callback(SLAndroidSimpleBufferQueueItf bq, void *context)
|
|||
ts.tv_nsec += 100000;
|
||||
rc = pthread_cond_timedwait(&(buffer->cond), &(buffer->mutex), &ts);
|
||||
if (rc != 0) {
|
||||
// if there is a timeout or some other error, we are probably suspended
|
||||
pthread_mutex_unlock(&(buffer->mutex));
|
||||
return;
|
||||
if (devState->threadShouldRun == 0) {
|
||||
// we are probably suspended
|
||||
pthread_mutex_unlock(&(buffer->mutex));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue