summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-03-13 15:01:06 -0700
committerGlenn Kasten <gkasten@google.com>2014-03-14 14:49:37 -0700
commit570f633e0b02d1bc25f3312b92e72cc29a40ca38 (patch)
tree3f75613bffba57b64f3bb7abc2f467c13d3f2019 /services/audioflinger/AudioFlinger.cpp
parente848bd9abb3bbbd4c66f9fb9d1442f7663d7ba40 (diff)
downloadframeworks_av-570f633e0b02d1bc25f3312b92e72cc29a40ca38.zip
frameworks_av-570f633e0b02d1bc25f3312b92e72cc29a40ca38.tar.gz
frameworks_av-570f633e0b02d1bc25f3312b92e72cc29a40ca38.tar.bz2
Make session ID code similar between output and capture
Change-Id: I873a97d0e36e1a452421df4f749d51e1916797a5
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ef31eb9..9953f64 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -569,19 +569,19 @@ sp<IAudioTrack> AudioFlinger::createTrack(
PlaybackThread *effectThread = NULL;
if (sessionId != NULL && *sessionId != AUDIO_SESSION_ALLOCATE) {
+ lSessionId = *sessionId;
// 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) {
- uint32_t sessions = t->hasAudioSession(*sessionId);
+ uint32_t sessions = t->hasAudioSession(lSessionId);
if (sessions & PlaybackThread::EFFECT_SESSION) {
effectThread = t.get();
break;
}
}
}
- lSessionId = *sessionId;
} else {
// if no audio session id is provided, create one here
lSessionId = nextUniqueId();
@@ -1368,17 +1368,17 @@ sp<IAudioRecord> AudioFlinger::openRecord(
pid_t pid = IPCThreadState::self()->getCallingPid();
client = registerPid_l(pid);
- // If no audio session id is provided, create one here
if (sessionId != NULL && *sessionId != AUDIO_SESSION_ALLOCATE) {
lSessionId = *sessionId;
} else {
+ // if no audio session id is provided, create one here
lSessionId = nextUniqueId();
if (sessionId != NULL) {
*sessionId = lSessionId;
}
}
- // create new record track.
- // The record track uses one track in mHardwareMixerThread by convention.
+ ALOGV("openRecord() lSessionId: %d", lSessionId);
+
// TODO: the uid should be passed in as a parameter to openRecord
recordTrack = thread->createRecordTrack_l(client, sampleRate, format, channelMask,
frameCount, lSessionId,