summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-02-28 16:52:51 -0800
committerEric Laurent <elaurent@google.com>2011-02-28 16:52:51 -0800
commit243f5f91755c01614a8cafe90b0806396e22d553 (patch)
treed6f4e9f1593f468967f75a82f21d8058a93c5ed1 /services/audioflinger/AudioMixer.h
parent8ddeebb93cb41e7a8e9fe763afb6c6016b21fa61 (diff)
downloadframeworks_av-243f5f91755c01614a8cafe90b0806396e22d553.zip
frameworks_av-243f5f91755c01614a8cafe90b0806396e22d553.tar.gz
frameworks_av-243f5f91755c01614a8cafe90b0806396e22d553.tar.bz2
Fix issue 3479042.
The problem is that when an AudioRecord using the resampler is restarted, the resampler state is not reset (as there is no reset function in the resampler). The consequence is that the first time the record thread loop runs, it calls the resampler which consumes the remaining data in the input buffer and when this buffer is released the input index is incremented over the limit. The fix consists in implementing a reset function in the resampler. A similar problem was also present for playback but unoticed because the track buffer is always drained by the mixer when a track stops. The only problem for playback was that the initial phase fraction was wrong when restarting a track after stop (it was correct after a pause). Change-Id: Ifc2585d685f4402d29f4afc63f6efd1d69265de3
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r--services/audioflinger/AudioMixer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index aee3e17..88408a7 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -67,6 +67,7 @@ public:
AUX_BUFFER = 0x4003,
// for TARGET RESAMPLE
SAMPLE_RATE = 0x4100,
+ RESET = 0x4101,
// for TARGET VOLUME (8 channels max)
VOLUME0 = 0x4200,
VOLUME1 = 0x4201,
@@ -163,6 +164,7 @@ private:
bool setResampler(uint32_t sampleRate, uint32_t devSampleRate);
bool doesResample() const;
+ void resetResampler();
void adjustVolumeRamp(bool aux);
};