diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-09 11:52:12 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-09 11:52:12 -0700 |
commit | b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54 (patch) | |
tree | e167affc928677f3dd70e173150a77e3943e97a9 /media/libmedia | |
parent | f5b4b98fada53d91c4c2ebeb5a1d33ccc95c94d2 (diff) | |
download | frameworks_base-b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54.zip frameworks_base-b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54.tar.gz frameworks_base-b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54.tar.bz2 |
auto import from //branches/cupcake/...@137197
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 5416629..8560593 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -182,8 +182,9 @@ bool ToneGenerator::startTone(int toneType) { mLock.lock(); if (mState == TONE_STARTING) { LOGV("Wait for start callback"); - if (mWaitCbkCond.waitRelative(mLock, seconds(1)) != NO_ERROR) { - LOGE("--- Immediate start timed out"); + status_t lStatus = mWaitCbkCond.waitRelative(mLock, seconds(1)); + if (lStatus != NO_ERROR) { + LOGE("--- Immediate start timed out, status %d", lStatus); mState = TONE_IDLE; lResult = false; } @@ -195,13 +196,14 @@ bool ToneGenerator::startTone(int toneType) { LOGV("Delayed start\n"); mState = TONE_RESTARTING; - if (mWaitCbkCond.waitRelative(mLock, seconds(1)) == NO_ERROR) { + status_t lStatus = mWaitCbkCond.waitRelative(mLock, seconds(1)); + if (lStatus == NO_ERROR) { if (mState != TONE_IDLE) { lResult = true; } LOGV("cond received"); } else { - LOGE("--- Delayed start timed out"); + LOGE("--- Delayed start timed out, status %d", lStatus); mState = TONE_IDLE; } } @@ -368,6 +370,8 @@ void ToneGenerator::audioCallback(int event, void* user, void *info) { break; default: LOGV("Extra Cbk"); + // Force loop exit + lNumSmp = 0; goto audioCallback_EndLoop; } |