summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-05-24 11:45:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-24 11:45:25 -0700
commit6d80297a55ab12759ee00b7f99fa97584b430da0 (patch)
treea936d42443306cc034a709e77397873fd2a0d611 /services/audioflinger
parent3545690e39ff7033c906d12d8bb77a06013d3f3c (diff)
parent0cc6257030d3e6c649ea3ad807ecb9327ceb5b3e (diff)
downloadframeworks_av-6d80297a55ab12759ee00b7f99fa97584b430da0.zip
frameworks_av-6d80297a55ab12759ee00b7f99fa97584b430da0.tar.gz
frameworks_av-6d80297a55ab12759ee00b7f99fa97584b430da0.tar.bz2
am 0cc62570: am f436fdcf: audioflinger: change session check in createTrack.
* commit '0cc6257030d3e6c649ea3ad807ecb9327ceb5b3e': audioflinger: change session check in createTrack.
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 3abd833..0c1b4c1 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -474,19 +474,15 @@ sp<IAudioTrack> AudioFlinger::createTrack(
ALOGV("createTrack() sessionId: %d", (sessionId == NULL) ? -2 : *sessionId);
if (sessionId != NULL && *sessionId != AUDIO_SESSION_OUTPUT_MIX) {
+ // check if an effect chain with the same session ID is present on another
+ // output thread and move it here.
for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
sp<PlaybackThread> t = mPlaybackThreads.valueAt(i);
if (mPlaybackThreads.keyAt(i) != output) {
- // prevent same audio session on different output threads
uint32_t sessions = t->hasAudioSession(*sessionId);
- if (sessions & PlaybackThread::TRACK_SESSION) {
- ALOGE("createTrack() session ID %d already in use", *sessionId);
- lStatus = BAD_VALUE;
- goto Exit;
- }
- // check if an effect with same session ID is waiting for a track to be created
if (sessions & PlaybackThread::EFFECT_SESSION) {
effectThread = t.get();
+ break;
}
}
}