diff options
author | Eric Laurent <elaurent@google.com> | 2014-09-13 00:18:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-13 00:18:19 +0000 |
commit | 61cd63a51c87dde24c9b163033937fa304864512 (patch) | |
tree | f3f98c780fbb43988c0d701b07e8b6984e2196c9 /services | |
parent | e293c71cee0d00cda005baf5d0c2faa034812b7a (diff) | |
parent | 58f8eb7ae0ee400585bce6682a7212575115e758 (diff) | |
download | frameworks_av-61cd63a51c87dde24c9b163033937fa304864512.zip frameworks_av-61cd63a51c87dde24c9b163033937fa304864512.tar.gz frameworks_av-61cd63a51c87dde24c9b163033937fa304864512.tar.bz2 |
Merge "audio policy: fix check in creaateAudioPatch()" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 22c4e04..abdbc5c 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -2294,14 +2294,14 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch, } sp<DeviceDescriptor> srcDeviceDesc = mAvailableInputDevices.getDeviceFromId(patch->sources[0].id); + if (srcDeviceDesc == 0) { + return BAD_VALUE; + } //update source and sink with our own data as the data passed in the patch may // be incomplete. struct audio_patch newPatch = *patch; srcDeviceDesc->toAudioPortConfig(&newPatch.sources[0], &patch->sources[0]); - if (srcDeviceDesc == 0) { - return BAD_VALUE; - } for (size_t i = 0; i < patch->num_sinks; i++) { if (patch->sinks[i].type != AUDIO_PORT_TYPE_DEVICE) { |