summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@android.com>2014-01-29 17:48:44 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-29 17:48:44 +0000
commit1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe (patch)
tree41b83ec660ace65ac60b2d6061327ce9c7f33309 /services
parent06da69d57d90e180e1165905e6c703227a06f041 (diff)
parent7e79cd2d3067cdb7b9daf639cf772d4dd149c934 (diff)
downloadframeworks_av-1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe.zip
frameworks_av-1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe.tar.gz
frameworks_av-1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe.tar.bz2
Merge "AudioMixer: Remove tracks from enabledTracks after reseting outTemp"
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioMixer.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index df4e029..07dc6dd 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -1122,10 +1122,6 @@ void AudioMixer::process__genericNoResampling(state_t* state, int64_t pts)
t.bufferProvider->getNextBuffer(&t.buffer, pts);
t.frameCount = t.buffer.frameCount;
t.in = t.buffer.raw;
- // t.in == NULL can happen if the track was flushed just after having
- // been enabled for mixing.
- if (t.in == NULL)
- enabledTracks &= ~(1<<i);
}
e0 = enabledTracks;
@@ -1161,6 +1157,13 @@ void AudioMixer::process__genericNoResampling(state_t* state, int64_t pts)
aux = t.auxBuffer + numFrames;
}
while (outFrames) {
+ // t.in == NULL can happen if the track was flushed just after having
+ // been enabled for mixing.
+ if (t.in == NULL) {
+ enabledTracks &= ~(1<<i);
+ e1 &= ~(1<<i);
+ break;
+ }
size_t inFrames = (t.frameCount > outFrames)?outFrames:t.frameCount;
if (inFrames) {
t.hook(&t, outTemp + (BLOCKSIZE-outFrames)*MAX_NUM_CHANNELS, inFrames,