diff options
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 5 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index fb731b9..c5a7777 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -979,12 +979,12 @@ bool AudioRecord::AudioRecordThread::threadLoop() return true; } if (mPausedInt) { - mPausedInt = false; if (mPausedNs > 0) { (void) mMyCond.waitRelative(mMyLock, mPausedNs); } else { mMyCond.wait(mMyLock); } + mPausedInt = false; return true; } } @@ -1029,8 +1029,9 @@ void AudioRecord::AudioRecordThread::pause() void AudioRecord::AudioRecordThread::resume() { AutoMutex _l(mMyLock); - if (mPaused) { + if (mPaused || mPausedInt) { mPaused = false; + mPausedInt = false; mMyCond.signal(); } } diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index fdcf911..754a4e3 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1800,12 +1800,12 @@ bool AudioTrack::AudioTrackThread::threadLoop() return true; } if (mPausedInt) { - mPausedInt = false; if (mPausedNs > 0) { (void) mMyCond.waitRelative(mMyLock, mPausedNs); } else { mMyCond.wait(mMyLock); } + mPausedInt = false; return true; } } @@ -1850,8 +1850,9 @@ void AudioTrack::AudioTrackThread::pause() void AudioTrack::AudioTrackThread::resume() { AutoMutex _l(mMyLock); - if (mPaused) { + if (mPaused || mPausedInt) { mPaused = false; + mPausedInt = false; mMyCond.signal(); } } |