framework/base: Fix for Camera shutter sound heard twice
- While back to back Camera snapshots, some times the shutter sound is heard twice. - The AwesomePlayer issues start on AudioPlayer first and then issues the seekTo. The starting of AudioPlayer starts the AudioTrackThread in AudioTrack which starts pulling the data from AudioPlayer by calling fillBuffer(). Sometimes it is observed that AudioTrackThread pulls some data and writes to AudioFlinger by the time the AudioPlayer->seekTo() is processed in the fillBuffer. This data is not being flushed as the playback track in AudioFlinger is not in PAUSED/PAUSING state. Once the seek is performed in AudioPlayer, the data comes from the beginning of the clip again. This data adds to the data already present with AudioFlinger and results in shutter sound being heard twice. - Fix by calling seekAudioIfNecessary_l before starting the AudioPlayer. This will set mSeeking flag of AudioPlayer and hence seek is processed with the first fillBuffer call itself. Change-Id: Iafd5a1a3b3f5dce760ebcab7d80a895f47c22dd2 CRs-Fixed: 277318
Loading
Please register or sign in to comment