diff options
author | Eric Laurent <elaurent@google.com> | 2013-03-26 12:25:30 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-03-26 12:25:30 -0700 |
commit | 6386b50b67185a966d43ee761acdfe7add569d10 (patch) | |
tree | 3e8bcf768efd7a66f82dfab1d6102190aeb902bb /media | |
parent | cd77d4a1d38b7609a03f6826a1ff5fa7c98aa34f (diff) | |
download | frameworks_av-6386b50b67185a966d43ee761acdfe7add569d10.zip frameworks_av-6386b50b67185a966d43ee761acdfe7add569d10.tar.gz frameworks_av-6386b50b67185a966d43ee761acdfe7add569d10.tar.bz2 |
ToneGenerator: fix AudioTrack pointer init
The pointer to AudioTrack should be initialized before
early return from ToneGenerator constructor because
it is tested by the destructor.
Bug 8140963
Change-Id: I9a7dfb60ba162b75dfaa5630ab7fc9485afd0074
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 1c0268f..58d495e 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -803,6 +803,7 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool ALOGV("ToneGenerator constructor: streamType=%d, volume=%f", streamType, volume); mState = TONE_IDLE; + mpAudioTrack = NULL; if (AudioSystem::getOutputSamplingRate(&mSamplingRate, streamType) != NO_ERROR) { ALOGE("Unable to marshal AudioFlinger"); @@ -811,7 +812,6 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mThreadCanCallJava = threadCanCallJava; mStreamType = streamType; mVolume = volume; - mpAudioTrack = NULL; mpToneDesc = NULL; mpNewToneDesc = NULL; // Generate tone by chunks of 20 ms to keep cadencing precision |