Store AudioTrack return value for error condition

Store AudioTrack->initCheck()'s return value so we can return it after
the AudioTrack is deleted.

Change-Id: Ie042a7d6a54d7f9afd8a5767cfd167dbeb2e5c04
This commit is contained in:
Kenny Root
2010-02-18 09:03:06 -08:00
parent c948cc8c8a
commit 3cbd62c3ce

View File

@@ -99,13 +99,13 @@ status_t AudioPlayer::start() {
: AudioSystem::CHANNEL_OUT_MONO,
8192, 0, &AudioCallback, this, 0);
if (mAudioTrack->initCheck() != OK) {
if ((err = mAudioTrack->initCheck()) != OK) {
delete mAudioTrack;
mAudioTrack = NULL;
mSource->stop();
return mAudioTrack->initCheck();
return err;
}
mLatencyUs = (int64_t)mAudioTrack->latency() * 1000;