diff options
author | Eric Laurent <elaurent@google.com> | 2015-04-21 15:07:36 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-22 08:12:53 -0700 |
commit | 493404d8c396e15ed73455acd39aa0f1940996e2 (patch) | |
tree | a07080e7733732fd7273963cca1c93436b86b997 /services/audiopolicy/common | |
parent | c9c3804a2caf3c0f96e7a8985f82db7ceef490df (diff) | |
download | frameworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.zip frameworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.tar.gz frameworks_av-493404d8c396e15ed73455acd39aa0f1940996e2.tar.bz2 |
audio policy: fix AudioTrack output device selection
Have AudioTrack::setOutputDevice() set CBLK_INVALID flag instead
of calling restoreTrack_l(). This allows restoreTrack_l() to be called in
a safe context.
Allow device change while the AudioTrack is active by forcing a new
device selection in startOutput() if the output route for this
session was changed.
Remove some warnings.
Change-Id: I2d921a63c9bfa0e122233645e2d6d39f95f5f17d
Diffstat (limited to 'services/audiopolicy/common')
-rw-r--r-- | services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp index 9573583..0715eea 100644 --- a/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp +++ b/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp @@ -52,6 +52,9 @@ bool DeviceDescriptor::equals(const sp<DeviceDescriptor>& other) const // - are of the same type (a device type cannot be AUDIO_DEVICE_NONE) // - have the same address or one device does not specify the address // - have the same channel mask or one device does not specify the channel mask + if (other == 0) { + return false; + } return (mDeviceType == other->mDeviceType) && (mAddress == "" || other->mAddress == "" || mAddress == other->mAddress) && (mChannelMask == 0 || other->mChannelMask == 0 || |