Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 38ce282c authored by Yogesh Sadhu's avatar Yogesh Sadhu Committed by Arne Coucheron
Browse files

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
parent 45c96327
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment