Merge "audio: Re-arrange member var initializations"
This commit is contained in:
commit
c5a04b45d9
|
@ -854,9 +854,6 @@ static void *offload_thread_loop(void *context)
|
|||
struct stream_out *out = (struct stream_out *) context;
|
||||
struct listnode *item;
|
||||
|
||||
out->offload_state = OFFLOAD_STATE_IDLE;
|
||||
out->playback_started = 0;
|
||||
|
||||
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_AUDIO);
|
||||
set_sched_policy(0, SP_FOREGROUND);
|
||||
prctl(PR_SET_NAME, (unsigned long)"Offload Callback", 0, 0, 0);
|
||||
|
@ -2000,6 +1997,13 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
|
|||
*stream_out = NULL;
|
||||
out = (struct stream_out *)calloc(1, sizeof(struct stream_out));
|
||||
|
||||
if (!out) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
|
||||
pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);
|
||||
|
||||
if (devices == AUDIO_DEVICE_NONE)
|
||||
devices = AUDIO_DEVICE_OUT_SPEAKER;
|
||||
|
||||
|
@ -2099,6 +2103,9 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
|
|||
out->non_blocking = 1;
|
||||
|
||||
out->send_new_metadata = 1;
|
||||
out->offload_state = OFFLOAD_STATE_IDLE;
|
||||
out->playback_started = 0;
|
||||
|
||||
create_offload_callback_thread(out);
|
||||
ALOGV("%s: offloaded output offload_info version %04x bit rate %d",
|
||||
__func__, config->offload_info.version,
|
||||
|
@ -2176,9 +2183,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
|
|||
/* out->muted = false; by calloc() */
|
||||
/* out->written = 0; by calloc() */
|
||||
|
||||
pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
|
||||
pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);
|
||||
|
||||
config->format = out->stream.common.get_format(&out->stream.common);
|
||||
config->channel_mask = out->stream.common.get_channels(&out->stream.common);
|
||||
config->sample_rate = out->stream.common.get_sample_rate(&out->stream.common);
|
||||
|
|
Loading…
Reference in New Issue