am 257fde6e: Reroute submix HAL: fix race condition on output state

* commit '257fde6eb533b890776c8c45be8b61c48ab04945':
  Reroute submix HAL: fix race condition on output state
This commit is contained in:
Jean-Michel Trivi 2014-12-10 22:36:20 +00:00 committed by Android Git Automerger
commit de148628b9

View file

@ -1036,9 +1036,10 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
SUBMIX_ALOGV("in_read bytes=%zu", bytes);
pthread_mutex_lock(&rsxadev->lock);
const bool output_standby_transition =
(in->output_standby_rec_thr != rsxadev->routes[in->route_handle].output->output_standby);
in->output_standby_rec_thr = rsxadev->routes[in->route_handle].output->output_standby;
const bool output_standby = rsxadev->routes[in->route_handle].output == NULL
? true : rsxadev->routes[in->route_handle].output->output_standby;
const bool output_standby_transition = (in->output_standby_rec_thr != output_standby);
in->output_standby_rec_thr = output_standby;
if (in->input_standby || output_standby_transition) {
in->input_standby = false;