diff options
author | Eric Laurent <elaurent@google.com> | 2014-07-27 13:47:31 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2014-07-27 20:52:03 +0000 |
commit | d8622371d5ac5b98abcc5d388bd952bb3dd4fda9 (patch) | |
tree | 709dc2e8ce206dc20fcf2f509a400a801096f934 /services/audiopolicy/AudioPolicyManager.cpp | |
parent | 0fb47759256ecdaedbc34c880238bc9d102ef160 (diff) | |
download | frameworks_av-d8622371d5ac5b98abcc5d388bd952bb3dd4fda9.zip frameworks_av-d8622371d5ac5b98abcc5d388bd952bb3dd4fda9.tar.gz frameworks_av-d8622371d5ac5b98abcc5d388bd952bb3dd4fda9.tar.bz2 |
audiopolicy: fix output audio format selection
Fix two problems in output stream audio format selection
added by commit 1e693b55:
- flags must be set before picking the format.
- fix logic error in best format selection.
Change-Id: I6458b32725f771da5a08108932d64e71964ae9f1
Diffstat (limited to 'services/audiopolicy/AudioPolicyManager.cpp')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index aa6a389..f1d65f0 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4627,13 +4627,13 @@ AudioPolicyManager::AudioOutputDescriptor::AudioOutputDescriptor( } if (profile != NULL) { mAudioPort = profile; + mFlags = profile->mFlags; mSamplingRate = profile->pickSamplingRate(); mFormat = profile->pickFormat(); mChannelMask = profile->pickChannelMask(); if (profile->mGains.size() > 0) { profile->mGains[0]->getDefaultConfig(&mGain); } - mFlags = profile->mFlags; } } @@ -5470,7 +5470,7 @@ audio_format_t AudioPolicyManager::AudioPort::pickFormat() const // limit format otherwise if ((mType != AUDIO_PORT_TYPE_MIX) || ((mRole == AUDIO_PORT_ROLE_SOURCE) && - (((mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) == 0)))) { + (((mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) != 0)))) { bestFormat = AUDIO_FORMAT_INVALID; } |