diff options
author | Ethan Chen <intervigil@gmail.com> | 2016-03-24 17:17:46 -0700 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-03-24 17:20:55 -0700 |
commit | 6cd7a60959c33917c526f6b11389816108edf719 (patch) | |
tree | 74f2abad6387b7e0a65e3599e90b59ff8655df51 | |
parent | c2c2cbf23e2fc6f001a942069cb5e67b7772c08b (diff) | |
download | android_packages_apps_FMRadio-6cd7a60959c33917c526f6b11389816108edf719.tar.gz android_packages_apps_FMRadio-6cd7a60959c33917c526f6b11389816108edf719.tar.bz2 android_packages_apps_FMRadio-6cd7a60959c33917c526f6b11389816108edf719.zip |
FMRadio: Immediately mute AudioTrack once stopRender is called
* This is kind of a hack, to squelch any possible output from when
stopRender is called to when AudioTrack.stop is called. This is
because the render thread may be playing audio and not respond
immediately to a stopRender call, resulting in garbage being written
to the output once the FM input is shut down. (such as in the case of
the headphone/antenna being removed).
REF: KIPPER-560
Change-Id: Id9dab17ca95a41e5a98c16fc8bc58d9e414e4efc
-rw-r--r-- | src/com/android/fmradio/FmService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/fmradio/FmService.java b/src/com/android/fmradio/FmService.java index 7e89237..553b6fa 100644 --- a/src/com/android/fmradio/FmService.java +++ b/src/com/android/fmradio/FmService.java @@ -410,6 +410,9 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan private synchronized void stopRender() { Log.d(TAG, "stopRender"); mIsRender = false; + // HACK: Set volume to 0 to squelch any output between the call to + // stopRender and the render thread calling AudioTrack.stop + mAudioTrack.setVolume(0.0f); } private synchronized void createRenderThread() { |