summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-09-30 19:20:15 -0700
committerEric Laurent <elaurent@google.com>2013-09-30 19:20:15 -0700
commit727fef1b1a8cb6d6609ec99a749fcd9573a3417d (patch)
treecda28cc9b80e536d5725abeb518b463325872694 /audio
parent962a0a4d759d67b8e8d920a88eaa1ff349df6f11 (diff)
downloadhardware_libhardware_legacy-727fef1b1a8cb6d6609ec99a749fcd9573a3417d.zip
hardware_libhardware_legacy-727fef1b1a8cb6d6609ec99a749fcd9573a3417d.tar.gz
hardware_libhardware_legacy-727fef1b1a8cb6d6609ec99a749fcd9573a3417d.tar.bz2
remove audio HAL warning when inserting a headset
A valid offload info structure must be provided when opening an offload output stream in checkOutputsForDevice() upon headset insertion. Bug: 8174034. Change-Id: Id800a206536e5ce979febf89747a51db581c53b6
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioPolicyManagerBase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index bc9cff4..3ee1f0f 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -1825,13 +1825,19 @@ status_t AudioPolicyManagerBase::checkOutputsForDevice(audio_devices_t device,
ALOGV("opening output for device %08x", device);
desc = new AudioOutputDescriptor(profile);
desc->mDevice = device;
+ audio_offload_info_t offloadInfo = AUDIO_INFO_INITIALIZER;
+ offloadInfo.sample_rate = desc->mSamplingRate;
+ offloadInfo.format = desc->mFormat;
+ offloadInfo.channel_mask = desc->mChannelMask;
+
audio_io_handle_t output = mpClientInterface->openOutput(profile->mModule->mHandle,
&desc->mDevice,
&desc->mSamplingRate,
&desc->mFormat,
&desc->mChannelMask,
&desc->mLatency,
- desc->mFlags);
+ desc->mFlags,
+ &offloadInfo);
if (output != 0) {
if (desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) {
String8 reply;