From 071ccd5a9702500f3f7d62ef881300914926184d Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 22 Dec 2011 16:08:41 -0800 Subject: audioflinger: fix clicks on 48kHz audio. The calculation done in prepareTracks_l() for the minimum amount off frames needed to mix one output buffer had 2 issues: - the additional sample needed for interpolation was not included - the fact that the resampler does not acknowledge the frames consumed immediately after each mixing round but only once all frames requested have been used was not taken into account. Thus the number of frames available in track buffer could be considered sufficient although it was not and the resampler would abort producing a short silence perceived as a click. Issue 5727099. Change-Id: I7419847a7474c7d9f9170bedd0a636132262142c --- services/audioflinger/AudioResampler.h | 1 + 1 file changed, 1 insertion(+) (limited to 'services/audioflinger/AudioResampler.h') diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h index 9f06c1c..ffa690a 100644 --- a/services/audioflinger/AudioResampler.h +++ b/services/audioflinger/AudioResampler.h @@ -54,6 +54,7 @@ public: AudioBufferProvider* provider) = 0; virtual void reset(); + virtual size_t getUnreleasedFrames() { return mInputIndex; } protected: // number of bits for phase fraction - 30 bits allows nearly 2x downsampling -- cgit v1.1