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
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");
mThreadCanCallJava = threadCanCallJava;
mStreamType = streamType;
mVolume = volume;
- mpAudioTrack = NULL;
mpToneDesc = NULL;
mpNewToneDesc = NULL;
// Generate tone by chunks of 20 ms to keep cadencing precision