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 /media | |
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 'media')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 055556f..7869a84 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1014,10 +1014,9 @@ status_t AudioTrack::setOutputDevice(audio_port_handle_t deviceId) { AutoMutex lock(mLock); if (mSelectedDeviceId != deviceId) { mSelectedDeviceId = deviceId; - return restoreTrack_l("setOutputDevice() restart"); - } else { - return NO_ERROR; + android_atomic_or(CBLK_INVALID, &mCblk->mFlags); } + return NO_ERROR; } audio_port_handle_t AudioTrack::getOutputDevice() { |